summaryrefslogtreecommitdiff
path: root/xmake/modules/detect/sdks/find_xcode.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2022-08-21 16:27:52 +0800
committerGitHub <[email protected]>2022-08-21 16:27:52 +0800
commit1eebadef123f6c110a671fe041fd110899340bb4 (patch)
treeceee665362dbc6fb4412169f35ed62108841142b /xmake/modules/detect/sdks/find_xcode.lua
parente914ebdba3e47cd0fe90de6b8ade2c328e0d04b6 (diff)
parent82c2ee867dc33097800caa4d25ab44aa1696517b (diff)
Merge pull request #2695 from xmake-io/catalyst
add mac catalyst
Diffstat (limited to 'xmake/modules/detect/sdks/find_xcode.lua')
-rw-r--r--xmake/modules/detect/sdks/find_xcode.lua28
1 files changed, 27 insertions, 1 deletions
diff --git a/xmake/modules/detect/sdks/find_xcode.lua b/xmake/modules/detect/sdks/find_xcode.lua
index e3c927979..80f3daead 100644
--- a/xmake/modules/detect/sdks/find_xcode.lua
+++ b/xmake/modules/detect/sdks/find_xcode.lua
@@ -72,6 +72,29 @@ function _find_xcode_sdkver(sdkdir, opt)
end
end
+-- find the target minver
+function _find_target_minver(sdkdir, sdkver, opt)
+ opt = opt or {}
+ local target_minver = sdkver
+ if opt.plat == "macosx" then
+ if opt.appledev == "catalyst" then
+ local platsdkdir = "Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS*.*.sdk"
+ local dir = find_directory(platsdkdir, sdkdir)
+ if dir then
+ target_minver = dir:match("%d+%.%d+")
+ else
+ target_minver = "13.1"
+ end
+ else
+ local macos_ver = macos.version()
+ if macos_ver then
+ target_minver = macos_ver:major() .. "." .. macos_ver:minor()
+ end
+ end
+ end
+ return target_minver
+end
+
-- find the xcode toolchain
function _find_xcode(sdkdir, opt)
@@ -87,6 +110,9 @@ function _find_xcode(sdkdir, opt)
return {}
end
+ -- find the target minver
+ local target_minver = _find_target_minver(sdkdir, sdkver, opt)
+
-- find codesign
local codesign_identity, mobile_provision
if opt.find_codesign then
@@ -126,7 +152,7 @@ function _find_xcode(sdkdir, opt)
end
end
end
- return {sdkdir = sdkdir, sdkver = sdkver, codesign_identity = codesign_identity, mobile_provision = mobile_provision}
+ return {sdkdir = sdkdir, sdkver = sdkver, target_minver = target_minver, codesign_identity = codesign_identity, mobile_provision = mobile_provision}
end
-- find xcode toolchain