Skip to content

Commit

Permalink
iOS: forcing minVersion to 11.0 when using Xcode 14.3 (#570)
Browse files Browse the repository at this point in the history
  • Loading branch information
Shchvova authored May 3, 2023
1 parent 0510a48 commit 0e475c9
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 4 deletions.
16 changes: 15 additions & 1 deletion platform/resources/iPhonePackageApp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -913,7 +913,21 @@ local function packageApp( options )
identity=options.signingIdentity,
platform="iphoneos"
}
local bundleScript = '$(xcrun -f swift-stdlib-tool) --copy --verbose --scan-executable "{app}/{exe}" --scan-folder "{app}/Frameworks" --platform {platform} --toolchain "{sdkBase}/Toolchains/XcodeDefault.xctoolchain" --destination "{app}/Frameworks" --strip-bitcode '
local sdkVersion = captureCommandOutput("xcrun --sdk iphoneos --show-sdk-version")
if not sdkVersion then
return "Unable to get iOS SDK version"
end
sdkVersion = tonumber(string.match(sdkVersion, '%d+%.?%d*'))
if not sdkVersion then
return "Unable to parse SDK version"
end

local bundleScript
if sdkVersion >= 16.4 then
bundleScript = '$(xcrun -f swift-stdlib-tool) --copy --verbose --scan-executable "{app}/{exe}" --scan-folder "{app}/Frameworks" --platform {platform} --destination "{app}/Frameworks" --strip-bitcode '
else
bundleScript = '$(xcrun -f swift-stdlib-tool) --copy --verbose --scan-executable "{app}/{exe}" --scan-folder "{app}/Frameworks" --platform {platform} --toolchain "{sdkBase}/Toolchains/XcodeDefault.xctoolchain" --destination "{app}/Frameworks" --strip-bitcode '
end

if not options.signingIdentity then
bundleOptions.identity = "-"
Expand Down
12 changes: 9 additions & 3 deletions tools/buildsys-ios/libtemplate/Defaults.lua
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ local tableDuplicate = BuilderUtils.tableDuplicate
-------------------------------------------------------------------------------

-- Lowest version of iOS that Corona supports
local MIN_VERSION_DEFAULT = 8.0
local MIN_VERSION_DEFAULT = "8.0"
local MIN_VERSION_NEW = "11.0"

-- ============================================================================
-- Defaults.tools
Expand Down Expand Up @@ -82,13 +83,18 @@ function M:setSdkType( sdkType, minVersion )
self.options.sdkType = sdkType -- update sdktype

minVersion = minVersion or self.options.minVersion
self.options.minVersion = minVersion

local sdkVersion = xcrun( sdkType, "--show-sdk-version" )
assert( sdkVersion, "ERROR: Could not find iPhone SDK Version" )
sdkVersion = tonumber(string.match(sdkVersion, '%d+'))
sdkVersion = tonumber(string.match(sdkVersion, '%d+%.?%d*'))
assert( sdkVersion, "ERROR: Cannot convert iPhone SDK Version:", sdkVersion )

if sdkVersion >= 16.4 and tonumber(minVersion) < tonumber(MIN_VERSION_NEW) then
minVersion = MIN_VERSION_NEW
print("Forcing minVersion to 11.0")
end
self.options.minVersion = minVersion

if tonumber(minVersion) >= 10 or sdkVersion >= 16 then
modernSlices()
else
Expand Down

0 comments on commit 0e475c9

Please sign in to comment.