summaryrefslogtreecommitdiff
path: root/xmake/toolchains/xcode/check.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2020-06-20 00:38:29 +0800
committerruki <[email protected]>2020-06-19 21:50:59 +0800
commitf5392149886b2083ec0d6db2adef3da405297fe8 (patch)
tree12a41f554b7e4bce55a8fb6f8e46aee2c4eba3f9 /xmake/toolchains/xcode/check.lua
parentca1bd50cc1e0b5939311ac73c61180957763cbbc (diff)
improve xcode and msvc toolchains
Diffstat (limited to 'xmake/toolchains/xcode/check.lua')
-rw-r--r--xmake/toolchains/xcode/check.lua21
1 files changed, 18 insertions, 3 deletions
diff --git a/xmake/toolchains/xcode/check.lua b/xmake/toolchains/xcode/check.lua
index d5f79ab27f..e49957b17 100644
--- a/xmake/toolchains/xcode/check.lua
+++ b/xmake/toolchains/xcode/check.lua
@@ -35,8 +35,23 @@ function main(toolchain)
end
-- save target minver
- local xcode_sdkver = config.get("xcode_sdkver")
- local target_minver = config.get("target_minver")
+ --
+ -- @note we need to differentiate the version for the system,
+ -- because the xcode toolchain of iphoneos/macosx may need to be used at the same time.
+ --
+ -- e.g.
+ --
+ -- target("test")
+ -- set_toolchains("xcode", {plat = os.host(), arch = os.arch()})
+ --
+ local xcode_sdkver = toolchain:is_plat(config.plat()) and config.get("xcode_sdkver")
+ if not xcode_sdkver then
+ xcode_sdkver = config.get("xcode_sdkver_" .. toolchain:plat())
+ end
+ local target_minver = toolchain:is_plat(config.plat()) and config.get("target_minver")
+ if not target_minver then
+ target_minver = config.get("target_minver_" .. toolchain:plat())
+ end
if xcode_sdkver and not target_minver then
target_minver = xcode_sdkver
if toolchain:is_plat("macosx") then
@@ -45,7 +60,7 @@ function main(toolchain)
target_minver = macos_ver:major() .. "." .. macos_ver:minor()
end
end
- config.set("target_minver", target_minver)
+ config.set("target_minver_" .. toolchain:plat(), target_minver)
end
return true
end