summaryrefslogtreecommitdiff
path: root/xmake/toolchains/xcode/xmake.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2020-06-19 00:48:33 +0800
committerruki <[email protected]>2020-06-18 22:51:19 +0800
commit92dd2db73694ab13671db73194ab1e9fae1b9371 (patch)
tree1d4ae3f3c82999f6d67043a882d68286e8ea94b4 /xmake/toolchains/xcode/xmake.lua
parent53df324acd9c7432336a5894ceef578daa1ce38d (diff)
improve the plat/arch of toolchain
Diffstat (limited to 'xmake/toolchains/xcode/xmake.lua')
-rw-r--r--xmake/toolchains/xcode/xmake.lua14
1 files changed, 7 insertions, 7 deletions
diff --git a/xmake/toolchains/xcode/xmake.lua b/xmake/toolchains/xcode/xmake.lua
index 776c142af..7394c8a13 100644
--- a/xmake/toolchains/xcode/xmake.lua
+++ b/xmake/toolchains/xcode/xmake.lua
@@ -36,14 +36,14 @@ toolchain("xcode")
-- get cross
local cross, arch, simulator
- if is_plat("macosx") then
+ if toolchain:is_plat("macosx") then
cross = "xcrun -sdk macosx "
- elseif is_plat("iphoneos") then
- arch = get_config("arch") or os.arch()
+ elseif toolchain:is_plat("iphoneos") then
+ arch = toolchain:arch()
simulator = (arch == "i386" or arch == "x86_64")
cross = simulator and "xcrun -sdk iphonesimulator " or "xcrun -sdk iphoneos "
- elseif is_plat("watchos") then
- arch = get_config("arch") or os.arch()
+ elseif toolchain:is_plat("watchos") then
+ arch = toolchain:arch()
simulator = (arch == "i386")
cross = simulator and "xcrun -sdk watchsimulator " or "xcrun -sdk watchos "
else
@@ -67,7 +67,7 @@ toolchain("xcode")
if arch then
toolchain:set("toolset", "cpp", cross .. "clang -arch " .. arch .. " -E")
end
- if is_plat("macosx") then
+ if toolchain:is_plat("macosx") then
toolchain:set("toolset", "as", cross .. "clang")
elseif simulator then
toolchain:set("toolset", "as", cross .. "clang")
@@ -76,5 +76,5 @@ toolchain("xcode")
end
-- load configurations
- import("load_" .. get_config("plat"))(toolchain)
+ import("load_" .. toolchain:plat())(toolchain)
end)