Set Xcode target versions.

This commit is contained in:
Бранимир Караџић
2025-10-23 22:55:10 -07:00
parent 75dcd5673a
commit c266d68458

View File

@@ -109,10 +109,10 @@ function toolchain(_buildDir, _libDir)
newoption { newoption {
trigger = "xcode", trigger = "xcode",
value = "xcode_target", value = "target",
description = "Choose XCode target", description = "Choose XCode target; one of:",
allowed = { allowed = {
{ "osx", "OSX" }, { "osx", "macOS" },
{ "ios", "iOS" }, { "ios", "iOS" },
{ "tvos", "tvOS" }, { "tvos", "tvOS" },
{ "xros", "visionOS" }, { "xros", "visionOS" },
@@ -186,22 +186,40 @@ function toolchain(_buildDir, _libDir)
androidApiLevel = _OPTIONS["with-android"] androidApiLevel = _OPTIONS["with-android"]
end end
local iosPlatform = "" local iosPlatform = "8.0"
if _OPTIONS["with-ios"] then if _OPTIONS["with-ios"] then
iosPlatform = _OPTIONS["with-ios"] iosPlatform = _OPTIONS["with-ios"]
elseif _ACTION == "xcode11" then
iosPlatform = "8.0"
elseif _ACTION == "xcode14" then
iosPlatform = "11.0"
elseif _ACTION == "xcode15" then
iosPlatform = "12.0"
end end
local macosPlatform = "" local tvosPlatform = "9.0"
if _OPTIONS["with-macos"] then
macosPlatform = _OPTIONS["with-macos"]
end
local tvosPlatform = ""
if _OPTIONS["with-tvos"] then if _OPTIONS["with-tvos"] then
tvosPlatform = _OPTIONS["with-tvos"] tvosPlatform = _OPTIONS["with-tvos"]
elseif _ACTION == "xcode11" then
tvosPlatform = "9.0"
elseif _ACTION == "xcode14" then
tvosPlatform = "11.0"
elseif _ACTION == "xcode15" then
tvosPlatform = "12.0"
end end
local xrosPlatform = "" local macosPlatform = "10.13.6"
if _OPTIONS["with-macos"] then
macosPlatform = _OPTIONS["with-macos"]
elseif _ACTION == "xcode11" then
macosPlatform = "10.14.4"
elseif _ACTION == "xcode14" then
macosPlatform = "12.5"
elseif _ACTION == "xcode15" then
macosPlatform = "13.5"
end
local xrosPlatform = "1.0"
if _OPTIONS["with-xros"] then if _OPTIONS["with-xros"] then
xrosPlatform = _OPTIONS["with-xros"] xrosPlatform = _OPTIONS["with-xros"]
end end
@@ -450,23 +468,23 @@ function toolchain(_buildDir, _libDir)
return #str > 0 and str or def return #str > 0 and str or def
end end
if "osx" == _OPTIONS["xcode"] then if "macos" == _OPTIONS["xcode"] then
action.xcode.macOSTargetPlatformVersion = str_or(macosPlatform, "13.0") action.xcode.macOSTargetPlatformVersion = macosPlatform
premake.xcode.toolset = "macosx" premake.xcode.toolset = "macosx"
location (path.join(_buildDir, "projects", _ACTION .. "-osx")) location (path.join(_buildDir, "projects", _ACTION .. "-macos"))
elseif "ios" == _OPTIONS["xcode"] then elseif "ios" == _OPTIONS["xcode"] then
action.xcode.iOSTargetPlatformVersion = str_or(iosPlatform, "16.0") action.xcode.iOSTargetPlatformVersion = iosPlatform
premake.xcode.toolset = "iphoneos" premake.xcode.toolset = "iphoneos"
location (path.join(_buildDir, "projects", _ACTION .. "-ios")) location (path.join(_buildDir, "projects", _ACTION .. "-ios"))
elseif "tvos" == _OPTIONS["xcode"] then elseif "tvos" == _OPTIONS["xcode"] then
action.xcode.tvOSTargetPlatformVersion = str_or(tvosPlatform, "13.0") action.xcode.tvOSTargetPlatformVersion = tvosPlatform
premake.xcode.toolset = "appletvos" premake.xcode.toolset = "appletvos"
location (path.join(_buildDir, "projects", _ACTION .. "-tvos")) location (path.join(_buildDir, "projects", _ACTION .. "-tvos"))
elseif "xros" == _OPTIONS["xcode"] then elseif "xros" == _OPTIONS["xcode"] then
action.xcode.visionOSTargetPlatformVersion = str_or(xrosPlatform, "1.0") action.xcode.visionOSTargetPlatformVersion = xrosPlatform
premake.xcode.toolset = "xros" premake.xcode.toolset = "xros"
location (path.join(_buildDir, "projects", _ACTION .. "-xros")) location (path.join(_buildDir, "projects", _ACTION .. "-xros"))
end end