diff options
| author | ruki <[email protected]> | 2021-03-26 00:49:05 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2021-03-26 00:49:05 +0800 |
| commit | 17c2672e3aae56bfe765fda6adc9abc861d7342d (patch) | |
| tree | 011a3b0816e9269ff7177634e3bfc6a0d2b4e2d3 /xmake/toolchains/xcode/check.lua | |
| parent | 5b414ecebb74389487c946b9c4687ec08d2c1aa9 (diff) | |
improve xcode toolchain
Diffstat (limited to 'xmake/toolchains/xcode/check.lua')
| -rw-r--r-- | xmake/toolchains/xcode/check.lua | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/xmake/toolchains/xcode/check.lua b/xmake/toolchains/xcode/check.lua index 4f92369b2..066929f2d 100644 --- a/xmake/toolchains/xcode/check.lua +++ b/xmake/toolchains/xcode/check.lua @@ -59,6 +59,23 @@ function main(toolchain) end end + -- save xcode sysroot directory + local xcode_sysroot + if xcode.sdkdir and xcode_sdkver then + if toolchain:is_plat("macosx") then + xcode_sysroot = xcode.sdkdir .. "/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX" .. xcode_sdkver .. ".sdk" + elseif toolchain:is_plat("iphoneos") then + local platname = toolchain:is_arch("i386", "x86_64") and "iPhoneSimulator" or "iPhoneOS" + xcode_sysroot = format("%s/Contents/Developer/Platforms/%s.platform/Developer/SDKs/%s%s.sdk", xcode.sdkdir, platname, platname, xcode_sdkver) + elseif toolchain:is_plat("watchos") then + local platname = toolchain:is_arch("i386", "x86_64") and "WatchSimulator" or "WatchOS" + xcode_sysroot = format("%s/Contents/Developer/Platforms/%s.platform/Developer/SDKs/%s%s.sdk", xcode.sdkdir, platname, platname, xcode_sdkver) + end + end + if xcode_sysroot then + toolchain:config_set("xcode_sysroot", xcode_sysroot) + end + -- save target minver -- -- @note we need to differentiate the version for the system, |
