From f5392149886b2083ec0d6db2adef3da405297fe8 Mon Sep 17 00:00:00 2001 From: ruki Date: Sat, 20 Jun 2020 00:38:29 +0800 Subject: improve xcode and msvc toolchains --- xmake/toolchains/xcode/check.lua | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) (limited to 'xmake/toolchains/xcode/check.lua') 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 -- cgit v1.3.1