summaryrefslogtreecommitdiff
path: root/xmake/toolchains/xcode
diff options
context:
space:
mode:
authorruki <[email protected]>2021-05-19 00:37:33 +0800
committerruki <[email protected]>2021-05-19 00:37:33 +0800
commit376b206b27edafec967e965ffd72f220f604e609 (patch)
tree064efb57c94904fb65f60a3ff2da2c23cae22ed5 /xmake/toolchains/xcode
parentf835bf4a93025bd4e8877cc16a5f287333d0f9cb (diff)
improve xcode toolchain
Diffstat (limited to 'xmake/toolchains/xcode')
-rw-r--r--xmake/toolchains/xcode/load_iphoneos.lua10
-rw-r--r--xmake/toolchains/xcode/load_macosx.lua20
-rw-r--r--xmake/toolchains/xcode/load_watchos.lua10
3 files changed, 20 insertions, 20 deletions
diff --git a/xmake/toolchains/xcode/load_iphoneos.lua b/xmake/toolchains/xcode/load_iphoneos.lua
index b7596e7ce..fc52d5f3c 100644
--- a/xmake/toolchains/xcode/load_iphoneos.lua
+++ b/xmake/toolchains/xcode/load_iphoneos.lua
@@ -37,15 +37,15 @@ function main(toolchain)
local target_minver_flags = (simulator and "-mios-simulator-version-min=" or "-miphoneos-version-min=") .. target_minver
-- init flags for c/c++
- toolchain:add("cxflags", "-arch " .. arch, target_minver_flags, "-isysroot " .. xcode_sysroot)
- toolchain:add("ldflags", "-arch " .. arch, "-ObjC", "-lstdc++", "-fobjc-link-runtime", target_minver_flags, "-isysroot " .. xcode_sysroot)
- toolchain:add("shflags", "-arch " .. arch, "-ObjC", "-lstdc++", "-fobjc-link-runtime", target_minver_flags, "-isysroot " .. xcode_sysroot)
+ toolchain:add("cxflags", "-arch", arch, target_minver_flags, "-isysroot", xcode_sysroot)
+ toolchain:add("ldflags", "-arch", arch, "-ObjC", "-lstdc++", "-fobjc-link-runtime", target_minver_flags, "-isysroot", xcode_sysroot)
+ toolchain:add("shflags", "-arch", arch, "-ObjC", "-lstdc++", "-fobjc-link-runtime", target_minver_flags, "-isysroot", xcode_sysroot)
-- init flags for objc/c++
- toolchain:add("mxflags", "-arch " .. arch, target_minver_flags, "-isysroot " .. xcode_sysroot)
+ toolchain:add("mxflags", "-arch", arch, target_minver_flags, "-isysroot", xcode_sysroot)
-- init flags for asm
- toolchain:add("asflags", "-arch " .. arch, target_minver_flags, "-isysroot " .. xcode_sysroot)
+ toolchain:add("asflags", "-arch", arch, target_minver_flags, "-isysroot", xcode_sysroot)
-- init flags for swift (with toolchain:add("ldflags and toolchain:add("shflags)
toolchain:add("scflags", format("-target %s-apple-ios%s", arch, target_minver) , "-sdk " .. xcode_sysroot)
diff --git a/xmake/toolchains/xcode/load_macosx.lua b/xmake/toolchains/xcode/load_macosx.lua
index 6c3ab454a..4c46a1fc3 100644
--- a/xmake/toolchains/xcode/load_macosx.lua
+++ b/xmake/toolchains/xcode/load_macosx.lua
@@ -30,9 +30,9 @@ function main(toolchain)
local xcode_sysroot = toolchain:config("xcode_sysroot")
-- init flags for c/c++
- toolchain:add("cxflags", "-arch " .. arch)
- toolchain:add("ldflags", "-arch " .. arch)
- toolchain:add("shflags", "-arch " .. arch)
+ toolchain:add("cxflags", "-arch", arch)
+ toolchain:add("ldflags", "-arch", arch)
+ toolchain:add("shflags", "-arch", arch)
if target_minver then
toolchain:add("cxflags", "-mmacosx-version-min=" .. target_minver)
toolchain:add("mxflags", "-mmacosx-version-min=" .. target_minver)
@@ -40,24 +40,24 @@ function main(toolchain)
toolchain:add("shflags", "-mmacosx-version-min=" .. target_minver)
end
if xcode_sysroot then
- toolchain:add("cxflags", "-isysroot " .. xcode_sysroot)
- toolchain:add("ldflags", "-isysroot " .. xcode_sysroot)
- toolchain:add("shflags", "-isysroot " .. xcode_sysroot)
+ toolchain:add("cxflags", "-isysroot", xcode_sysroot)
+ toolchain:add("ldflags", "-isysroot", xcode_sysroot)
+ toolchain:add("shflags", "-isysroot", xcode_sysroot)
end
toolchain:add("ldflags", "-stdlib=libc++")
toolchain:add("shflags", "-stdlib=libc++")
toolchain:add("syslinks", "z")
-- init flags for objc/c++ (with ldflags and shflags)
- toolchain:add("mxflags", "-arch " .. arch)
+ toolchain:add("mxflags", "-arch", arch)
if xcode_sysroot then
- toolchain:add("mxflags", "-isysroot " .. xcode_sysroot)
+ toolchain:add("mxflags", "-isysroot", xcode_sysroot)
end
-- init flags for asm
- toolchain:add("asflags", "-arch " .. arch)
+ toolchain:add("asflags", "-arch", arch)
if xcode_sysroot then
- toolchain:add("asflags", "-isysroot " .. xcode_sysroot)
+ toolchain:add("asflags", "-isysroot", xcode_sysroot)
end
-- init flags for swift
diff --git a/xmake/toolchains/xcode/load_watchos.lua b/xmake/toolchains/xcode/load_watchos.lua
index e0e4053e8..98ec4200e 100644
--- a/xmake/toolchains/xcode/load_watchos.lua
+++ b/xmake/toolchains/xcode/load_watchos.lua
@@ -34,15 +34,15 @@ function main(toolchain)
local target_minver_flags = (simulator and "-mwatchos-simulator-version-min=" or "-mwatchos-version-min=") .. target_minver
-- init flags for c/c++
- toolchain:add("cxflags", "-arch " .. arch, target_minver_flags, "-isysroot " .. xcode_sysroot)
- toolchain:add("ldflags", "-arch " .. arch, "-ObjC", "-lstdc++", "-fobjc-link-runtime", target_minver_flags, "-isysroot " .. xcode_sysroot)
- toolchain:add("shflags", "-arch " .. arch, "-ObjC", "-lstdc++", "-fobjc-link-runtime", target_minver_flags, "-isysroot " .. xcode_sysroot)
+ toolchain:add("cxflags", "-arch", arch, target_minver_flags, "-isysroot", xcode_sysroot)
+ toolchain:add("ldflags", "-arch", arch, "-ObjC", "-lstdc++", "-fobjc-link-runtime", target_minver_flags, "-isysroot", xcode_sysroot)
+ toolchain:add("shflags", "-arch", arch, "-ObjC", "-lstdc++", "-fobjc-link-runtime", target_minver_flags, "-isysroot", xcode_sysroot)
-- init flags for objc/c++
- toolchain:add("mxflags", "-arch " .. arch, target_minver_flags, "-isysroot " .. xcode_sysroot)
+ toolchain:add("mxflags", "-arch", arch, target_minver_flags, "-isysroot", xcode_sysroot)
-- init flags for asm
- toolchain:add("asflags", "-arch " .. arch, target_minver_flags, "-isysroot " .. xcode_sysroot)
+ toolchain:add("asflags", "-arch", arch, target_minver_flags, "-isysroot", xcode_sysroot)
-- init flags for swift (with toolchain:add("ldflags and toolchain:add("shflags)
toolchain:add("scflags", format("-target %s-apple-ios%s", arch, target_minver) , "-sdk " .. xcode_sysroot)