summaryrefslogtreecommitdiff
path: root/xmake/platforms
diff options
context:
space:
mode:
authorruki <[email protected]>2017-07-12 13:07:18 +0800
committerruki <[email protected]>2017-07-12 13:07:18 +0800
commitf6688e9eaff8ce02c097ba4e1da27d9efd8ece90 (patch)
tree00248715b7f53a9957d35d833fc4f3127a86f0f7 /xmake/platforms
parent7346528e00d1175b1ee4ce0c88234434a47a35ec (diff)
add os.args and fix command args
Diffstat (limited to 'xmake/platforms')
-rw-r--r--xmake/platforms/android/load.lua4
-rw-r--r--xmake/platforms/iphoneos/load.lua16
-rw-r--r--xmake/platforms/macosx/load.lua2
-rw-r--r--xmake/platforms/mingw/load.lua10
-rw-r--r--xmake/platforms/watchos/load.lua16
-rw-r--r--xmake/platforms/windows/xmake.lua6
6 files changed, 27 insertions, 27 deletions
diff --git a/xmake/platforms/android/load.lua b/xmake/platforms/android/load.lua
index 102540e71..36725f271 100644
--- a/xmake/platforms/android/load.lua
+++ b/xmake/platforms/android/load.lua
@@ -113,8 +113,8 @@ function main()
-- init flags for rust
_g.rcflags = { "--target=" .. targets[arch] }
- _g["rc-shflags"] = { "-C", "linker=" .. config.get("sh"), "-C", "link-args=\"" .. (table.concat(_g.shflags, " "):gsub("%-march=.-%s", "")) .. "\"" }
- _g["rc-ldflags"] = { "-C", "linker=" .. config.get("ld"), "-C", "link-args=\"" .. (table.concat(_g.ldflags, " "):gsub("%-march=.-%s", "")) .. "\"" }
+ _g["rc-shflags"] = { "-C", "linker=" .. config.get("sh"), "-C", "link-args=" .. (table.concat(_g.shflags, " "):gsub("%-march=.-%s", ""))}
+ _g["rc-ldflags"] = { "-C", "linker=" .. config.get("ld"), "-C", "link-args=" .. (table.concat(_g.ldflags, " "):gsub("%-march=.-%s", ""))}
-- ok
return _g
diff --git a/xmake/platforms/iphoneos/load.lua b/xmake/platforms/iphoneos/load.lua
index f6c67c88f..c422ef234 100644
--- a/xmake/platforms/iphoneos/load.lua
+++ b/xmake/platforms/iphoneos/load.lua
@@ -45,20 +45,20 @@ function main()
local xcode_sdkdir = format("%s/Contents/Developer/Platforms/%s.platform/Developer/SDKs/%s%s.sdk", xcode_dir, platname, platname, xcode_sdkver)
-- init flags for c/c++
- _g.cxflags = { "-arch " .. arch, target_minver_flags, "-isysroot " .. xcode_sdkdir }
- _g.ldflags = { "-arch " .. arch, "-ObjC", "-lstdc++", "-fobjc-link-runtime", target_minver_flags, "-isysroot " .. xcode_sdkdir }
- _g.shflags = { "-arch " .. arch, "-ObjC", "-lstdc++", "-fobjc-link-runtime", target_minver_flags, "-isysroot " .. xcode_sdkdir }
+ _g.cxflags = { "-arch", arch, target_minver_flags, "-isysroot", xcode_sdkdir }
+ _g.ldflags = { "-arch", arch, "-ObjC", "-lstdc++", "-fobjc-link-runtime", target_minver_flags, "-isysroot", xcode_sdkdir }
+ _g.shflags = { "-arch", arch, "-ObjC", "-lstdc++", "-fobjc-link-runtime", target_minver_flags, "-isysroot", xcode_sdkdir }
-- init flags for objc/c++
- _g.mxflags = { "-arch " .. arch, target_minver_flags, "-isysroot " .. xcode_sdkdir }
+ _g.mxflags = { "-arch", arch, target_minver_flags, "-isysroot", xcode_sdkdir }
-- init flags for asm
- _g.asflags = { "-arch " .. arch, target_minver_flags, "-isysroot " .. xcode_sdkdir }
+ _g.asflags = { "-arch", arch, target_minver_flags, "-isysroot", xcode_sdkdir }
-- init flags for swift (with _g.ldflags and _g.shflags)
- _g.scflags = { format("-target %s-apple-ios%s", arch, target_minver) , "-sdk " .. xcode_sdkdir }
- _g["sc-shflags"] = { format("-target %s-apple-ios%s", arch, target_minver) , "-sdk " .. xcode_sdkdir }
- _g["sc-ldflags"] = { format("-target %s-apple-ios%s", arch, target_minver) , "-sdk " .. xcode_sdkdir }
+ _g.scflags = { "-target", format("%s-apple-ios%s", arch, target_minver) , "-sdk", xcode_sdkdir }
+ _g["sc-shflags"] = { "-target", format("%s-apple-ios%s", arch, target_minver) , "-sdk", xcode_sdkdir }
+ _g["sc-ldflags"] = { "-target", format("%s-apple-ios%s", arch, target_minver) , "-sdk", xcode_sdkdir }
-- ok
return _g
diff --git a/xmake/platforms/macosx/load.lua b/xmake/platforms/macosx/load.lua
index aa85a92ee..6baf60dcd 100644
--- a/xmake/platforms/macosx/load.lua
+++ b/xmake/platforms/macosx/load.lua
@@ -43,7 +43,7 @@ function main()
_g.shflags = { "-arch", arch, "-mmacosx-version-min=" .. target_minver, "-isysroot", xcode_sdkdir, "-L/usr/local/lib", "-L/usr/lib", "-stdlib=libc++", "-lz" }
-- init flags for objc/c++ (with _g.ldflags and _g.shflags)
- _g.mxflags = { "-arch", arch, "-fpascal-strings", "-fmessage-length=0", "-isysroot " .. xcode_sdkdir }
+ _g.mxflags = { "-arch", arch, "-fpascal-strings", "-fmessage-length=0", "-isysroot", xcode_sdkdir }
-- init flags for asm (with _g.ldflags and _g.shflags)
_g.asflags = { "-arch", arch, "-isysroot", xcode_sdkdir }
diff --git a/xmake/platforms/mingw/load.lua b/xmake/platforms/mingw/load.lua
index 0199573d9..a312e8cff 100644
--- a/xmake/platforms/mingw/load.lua
+++ b/xmake/platforms/mingw/load.lua
@@ -34,13 +34,13 @@ function main()
if arch then
if arch == "x86_64" then archflags = "-m64"
elseif arch == "i386" then archflags = "-m32"
- else archflags = "-arch " .. arch
+ else archflags = {"-arch", arch}
end
end
- _g.cxflags = { archflags }
- _g.asflags = { archflags }
- _g.ldflags = { archflags }
- _g.shflags = { archflags }
+ _g.cxflags = table.wrap(archflags)
+ _g.asflags = table.wrap(archflags)
+ _g.ldflags = table.wrap(archflags)
+ _g.shflags = table.wrap(archflags)
-- init linkdirs and includedirs
local sdkdir = config.get("sdk")
diff --git a/xmake/platforms/watchos/load.lua b/xmake/platforms/watchos/load.lua
index 3d366f477..be5a96d82 100644
--- a/xmake/platforms/watchos/load.lua
+++ b/xmake/platforms/watchos/load.lua
@@ -45,20 +45,20 @@ function main()
local xcode_sdkdir = format("%s/Contents/Developer/Platforms/%s.platform/Developer/SDKs/%s%s.sdk", xcode_dir, platname, platname, xcode_sdkver)
-- init flags for c/c++
- _g.cxflags = { "-arch " .. arch, target_minver_flags, "-isysroot " .. xcode_sdkdir }
- _g.ldflags = { "-arch " .. arch, "-ObjC", "-lstdc++", "-fobjc-link-runtime", target_minver_flags, "-isysroot " .. xcode_sdkdir }
- _g.shflags = { "-arch " .. arch, "-ObjC", "-lstdc++", "-fobjc-link-runtime", target_minver_flags, "-isysroot " .. xcode_sdkdir }
+ _g.cxflags = { "-arch", arch, target_minver_flags, "-isysroot", xcode_sdkdir }
+ _g.ldflags = { "-arch", arch, "-ObjC", "-lstdc++", "-fobjc-link-runtime", target_minver_flags, "-isysroot", xcode_sdkdir }
+ _g.shflags = { "-arch", arch, "-ObjC", "-lstdc++", "-fobjc-link-runtime", target_minver_flags, "-isysroot", xcode_sdkdir }
-- init flags for objc/c++
- _g.mxflags = { "-arch " .. arch, target_minver_flags, "-isysroot " .. xcode_sdkdir }
+ _g.mxflags = { "-arch", arch, target_minver_flags, "-isysroot", xcode_sdkdir }
-- init flags for asm
- _g.asflags = { "-arch " .. arch, target_minver_flags, "-isysroot " .. xcode_sdkdir }
+ _g.asflags = { "-arch", arch, target_minver_flags, "-isysroot", xcode_sdkdir }
-- init flags for swift (with _g.ldflags and _g.shflags)
- _g.scflags = { format("-target %s-apple-ios%s", arch, target_minver) , "-sdk " .. xcode_sdkdir }
- _g["sc-shflags"] = { format("-target %s-apple-ios%s", arch, target_minver) , "-sdk " .. xcode_sdkdir }
- _g["sc-ldflags"] = { format("-target %s-apple-ios%s", arch, target_minver) , "-sdk " .. xcode_sdkdir }
+ _g.scflags = { "-target", format("%s-apple-ios%s", arch, target_minver) , "-sdk", xcode_sdkdir }
+ _g["sc-shflags"] = { "-target", format("%s-apple-ios%s", arch, target_minver) , "-sdk", xcode_sdkdir }
+ _g["sc-ldflags"] = { "-target", format("%s-apple-ios%s", arch, target_minver) , "-sdk", xcode_sdkdir }
-- ok
return _g
diff --git a/xmake/platforms/windows/xmake.lua b/xmake/platforms/windows/xmake.lua
index 8c90aa9df..65066025d 100644
--- a/xmake/platforms/windows/xmake.lua
+++ b/xmake/platforms/windows/xmake.lua
@@ -53,9 +53,9 @@ platform("windows")
-- init flags for dlang
local dc_archs = { x86 = "-m32", x64 = "-m64" }
- _g.dcflags = { dc_archs[arch] or "" }
- _g["dc-shflags"] = { dc_archs[arch] or "" }
- _g["dc-ldflags"] = { dc_archs[arch] or "" }
+ _g.dcflags = { dc_archs[arch] }
+ _g["dc-shflags"] = { dc_archs[arch] }
+ _g["dc-ldflags"] = { dc_archs[arch] }
-- ok
return _g