mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Bump the deployment target for the compiler to macOS 13.0
Bump the deployment target from macOS 10.13-aligned versions to macOS 13.0-aligned versions. This allows us to stop linking CoreFoundation in the swift runtime, which was previously required for availability checking. It also lets us align the deployment target on x86_64 with arm64, which was 11.0. Finally, it is a prerequisite to being able to build swift using the macOS 15 beta SDKs. (cherry picked from commitad82d86041) (cherry picked from commitcd71e316ee)
This commit is contained in:
@@ -556,16 +556,16 @@ option(SWIFT_ALLOW_LINKING_SWIFT_CONTENT_IN_DARWIN_TOOLCHAIN
|
|||||||
This is needed to support Apple internal configurations."
|
This is needed to support Apple internal configurations."
|
||||||
FALSE)
|
FALSE)
|
||||||
|
|
||||||
set(SWIFT_DARWIN_DEPLOYMENT_VERSION_OSX "10.13" CACHE STRING
|
set(SWIFT_DARWIN_DEPLOYMENT_VERSION_OSX "13.0" CACHE STRING
|
||||||
"Minimum deployment target version for OS X")
|
"Minimum deployment target version for OS X")
|
||||||
|
|
||||||
set(SWIFT_DARWIN_DEPLOYMENT_VERSION_IOS "11.0" CACHE STRING
|
set(SWIFT_DARWIN_DEPLOYMENT_VERSION_IOS "16.0" CACHE STRING
|
||||||
"Minimum deployment target version for iOS")
|
"Minimum deployment target version for iOS")
|
||||||
|
|
||||||
set(SWIFT_DARWIN_DEPLOYMENT_VERSION_TVOS "11.0" CACHE STRING
|
set(SWIFT_DARWIN_DEPLOYMENT_VERSION_TVOS "16.0" CACHE STRING
|
||||||
"Minimum deployment target version for tvOS")
|
"Minimum deployment target version for tvOS")
|
||||||
|
|
||||||
set(SWIFT_DARWIN_DEPLOYMENT_VERSION_WATCHOS "4.0" CACHE STRING
|
set(SWIFT_DARWIN_DEPLOYMENT_VERSION_WATCHOS "9.0" CACHE STRING
|
||||||
"Minimum deployment target version for watchOS")
|
"Minimum deployment target version for watchOS")
|
||||||
|
|
||||||
set(SWIFT_DARWIN_DEPLOYMENT_VERSION_XROS "1.0" CACHE STRING
|
set(SWIFT_DARWIN_DEPLOYMENT_VERSION_XROS "1.0" CACHE STRING
|
||||||
|
|||||||
@@ -110,10 +110,10 @@ macro(configure_sdks_darwin)
|
|||||||
set(appletvos_arch "arm64")
|
set(appletvos_arch "arm64")
|
||||||
set(watchos_arch "armv7k" "arm64_32")
|
set(watchos_arch "armv7k" "arm64_32")
|
||||||
|
|
||||||
set(macosx_ver "10.13")
|
set(macosx_ver "13.0")
|
||||||
set(iphoneos_ver "11.0")
|
set(iphoneos_ver "16.0")
|
||||||
set(appletvos_ver "11.0")
|
set(appletvos_ver "16.0")
|
||||||
set(watchos_ver "4.0")
|
set(watchos_ver "9.0")
|
||||||
|
|
||||||
set(macosx_vendor "apple")
|
set(macosx_vendor "apple")
|
||||||
set(iphoneos_vendor "apple")
|
set(iphoneos_vendor "apple")
|
||||||
|
|||||||
@@ -18,6 +18,13 @@ set(SUPPORTED_OSX_ARCHS "x86_64;arm64")
|
|||||||
set(SUPPORTED_XROS_ARCHS "arm64;arm64e")
|
set(SUPPORTED_XROS_ARCHS "arm64;arm64e")
|
||||||
set(SUPPORTED_XROS_SIMULATOR_ARCHS "arm64")
|
set(SUPPORTED_XROS_SIMULATOR_ARCHS "arm64")
|
||||||
|
|
||||||
|
if(SWIFT_DARWIN_DEPLOYMENT_VERSION_WATCHOS VERSION_GREATER_EQUAL 7.0)
|
||||||
|
list(REMOVE_ITEM SUPPORTED_WATCHOS_SIMULATOR_ARCHS "i386")
|
||||||
|
endif()
|
||||||
|
if(SWIFT_DARWIN_DEPLOYMENT_VERSION_WATCHOS VERSION_GREATER_EQUAL 9.0)
|
||||||
|
list(REMOVE_ITEM SUPPORTED_WATCHOS_ARCHS "armv7k")
|
||||||
|
endif()
|
||||||
|
|
||||||
is_sdk_requested(OSX swift_build_osx)
|
is_sdk_requested(OSX swift_build_osx)
|
||||||
if(swift_build_osx)
|
if(swift_build_osx)
|
||||||
configure_sdk_darwin(
|
configure_sdk_darwin(
|
||||||
|
|||||||
@@ -4,9 +4,9 @@ config.substitutions = list(config.substitutions)
|
|||||||
if config.target_sdk_name == 'macosx':
|
if config.target_sdk_name == 'macosx':
|
||||||
def do_fixup(key, value):
|
def do_fixup(key, value):
|
||||||
if isinstance(value, str):
|
if isinstance(value, str):
|
||||||
value = value.replace("-apple-macosx10.13", "-apple-macos14")
|
value = value.replace("-apple-macosx13.0", "-apple-macos14")
|
||||||
elif isinstance(value, SubstituteCaptures):
|
elif isinstance(value, SubstituteCaptures):
|
||||||
value.substitution = value.substitution.replace("-apple-macosx10.13", "-apple-macos14")
|
value.substitution = value.substitution.replace("-apple-macosx13.0", "-apple-macos14")
|
||||||
return (key, value)
|
return (key, value)
|
||||||
|
|
||||||
config.substitutions = [do_fixup(a, b) for (a, b) in config.substitutions]
|
config.substitutions = [do_fixup(a, b) for (a, b) in config.substitutions]
|
||||||
|
|||||||
@@ -695,7 +695,7 @@ build-ninja
|
|||||||
# to LLVM_USE_RUNTIMES to build compiler-rt (#60993), so we can leverage
|
# to LLVM_USE_RUNTIMES to build compiler-rt (#60993), so we can leverage
|
||||||
# the value for SANITIZER_MIN_OSX_VERSION set in cmake_product.py
|
# the value for SANITIZER_MIN_OSX_VERSION set in cmake_product.py
|
||||||
extra-cmake-options=
|
extra-cmake-options=
|
||||||
-DCLANG_COMPILER_RT_CMAKE_ARGS:STRING="-DSANITIZER_MIN_OSX_VERSION:STRING=10.13"
|
-DCLANG_COMPILER_RT_CMAKE_ARGS:STRING="-DSANITIZER_MIN_OSX_VERSION:STRING=13.0"
|
||||||
|
|
||||||
# Do not build swift or cmark
|
# Do not build swift or cmark
|
||||||
skip-build-swift
|
skip-build-swift
|
||||||
|
|||||||
@@ -424,7 +424,7 @@ def apply_default_arguments(toolchain, args):
|
|||||||
for target in targets
|
for target in targets
|
||||||
if (not target.platform.is_darwin or
|
if (not target.platform.is_darwin or
|
||||||
target.platform.sdk_supports_architecture(
|
target.platform.sdk_supports_architecture(
|
||||||
target.arch, args.darwin_xcrun_toolchain))
|
target.arch, args.darwin_xcrun_toolchain, args))
|
||||||
]
|
]
|
||||||
|
|
||||||
# Include the Darwin module-only architectures in the CMake options.
|
# Include the Darwin module-only architectures in the CMake options.
|
||||||
|
|||||||
@@ -101,10 +101,10 @@ KNOWN_SETTINGS=(
|
|||||||
|
|
||||||
## Darwin Options
|
## Darwin Options
|
||||||
darwin-crash-reporter-client "" "whether to enable CrashReporter integration, default is 1 on Darwin platforms, 0 otherwise"
|
darwin-crash-reporter-client "" "whether to enable CrashReporter integration, default is 1 on Darwin platforms, 0 otherwise"
|
||||||
darwin-deployment-version-ios "11.0" "minimum deployment target version for iOS"
|
darwin-deployment-version-ios "16.0" "minimum deployment target version for iOS"
|
||||||
darwin-deployment-version-osx "10.13" "minimum deployment target version for OS X"
|
darwin-deployment-version-osx "13.0" "minimum deployment target version for OS X"
|
||||||
darwin-deployment-version-tvos "11.0" "minimum deployment target version for tvOS"
|
darwin-deployment-version-tvos "16.0" "minimum deployment target version for tvOS"
|
||||||
darwin-deployment-version-watchos "4.0" "minimum deployment target version for watchOS"
|
darwin-deployment-version-watchos "9.0" "minimum deployment target version for watchOS"
|
||||||
darwin-deployment-version-xros "1.0" "minimum deployment target version for xrOS"
|
darwin-deployment-version-xros "1.0" "minimum deployment target version for xrOS"
|
||||||
darwin-install-extract-symbols "" "whether to extract symbols with dsymutil during installations"
|
darwin-install-extract-symbols "" "whether to extract symbols with dsymutil during installations"
|
||||||
darwin-install-extract-symbols-use-just-built-dsymutil "1" "whether we should extract symbols using the just built dsymutil"
|
darwin-install-extract-symbols-use-just-built-dsymutil "1" "whether we should extract symbols using the just built dsymutil"
|
||||||
|
|||||||
@@ -52,10 +52,10 @@ CLANG_USER_VISIBLE_VERSION = Version('17.0.0')
|
|||||||
SWIFT_ANALYZE_CODE_COVERAGE = 'false'
|
SWIFT_ANALYZE_CODE_COVERAGE = 'false'
|
||||||
|
|
||||||
DARWIN_XCRUN_TOOLCHAIN = 'default'
|
DARWIN_XCRUN_TOOLCHAIN = 'default'
|
||||||
DARWIN_DEPLOYMENT_VERSION_OSX = '10.13'
|
DARWIN_DEPLOYMENT_VERSION_OSX = '13.0'
|
||||||
DARWIN_DEPLOYMENT_VERSION_IOS = '11.0'
|
DARWIN_DEPLOYMENT_VERSION_IOS = '16.0'
|
||||||
DARWIN_DEPLOYMENT_VERSION_TVOS = '11.0'
|
DARWIN_DEPLOYMENT_VERSION_TVOS = '16.0'
|
||||||
DARWIN_DEPLOYMENT_VERSION_WATCHOS = '4.0'
|
DARWIN_DEPLOYMENT_VERSION_WATCHOS = '9.0'
|
||||||
DARWIN_DEPLOYMENT_VERSION_XROS = '1.0'
|
DARWIN_DEPLOYMENT_VERSION_XROS = '1.0'
|
||||||
|
|
||||||
UNIX_INSTALL_PREFIX = '/usr'
|
UNIX_INSTALL_PREFIX = '/usr'
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ extension {Type}: _ObjectiveCBridgeable {{
|
|||||||
_getObjCTypeEncoding({Type}.self)) == 0,
|
_getObjCTypeEncoding({Type}.self)) == 0,
|
||||||
"NSValue does not contain the right type to bridge to {Type}")
|
"NSValue does not contain the right type to bridge to {Type}")
|
||||||
result = {Type}()
|
result = {Type}()
|
||||||
if #available(OSX 10.13, iOS 11.0, tvOS 11.0, watchOS 4.0, *) {{
|
if #available(OSX 13.0, iOS 16.0, tvOS 16.0, watchOS 9.0, *) {{
|
||||||
source.getValue(&result!, size: MemoryLayout<{Type}>.size)
|
source.getValue(&result!, size: MemoryLayout<{Type}>.size)
|
||||||
}} else {{
|
}} else {{
|
||||||
source.getValue(&result!)
|
source.getValue(&result!)
|
||||||
@@ -27,7 +27,7 @@ extension {Type}: _ObjectiveCBridgeable {{
|
|||||||
return false
|
return false
|
||||||
}}
|
}}
|
||||||
result = {Type}()
|
result = {Type}()
|
||||||
if #available(OSX 10.13, iOS 11.0, tvOS 11.0, watchOS 4.0, *) {{
|
if #available(OSX 13.0, iOS 16.0, tvOS 16.0, watchOS 9.0, *) {{
|
||||||
source.getValue(&result!, size: MemoryLayout<{Type}>.size)
|
source.getValue(&result!, size: MemoryLayout<{Type}>.size)
|
||||||
}} else {{
|
}} else {{
|
||||||
source.getValue(&result!)
|
source.getValue(&result!)
|
||||||
@@ -42,7 +42,7 @@ extension {Type}: _ObjectiveCBridgeable {{
|
|||||||
_getObjCTypeEncoding({Type}.self)) == 0,
|
_getObjCTypeEncoding({Type}.self)) == 0,
|
||||||
"NSValue does not contain the right type to bridge to {Type}")
|
"NSValue does not contain the right type to bridge to {Type}")
|
||||||
var result = {Type}()
|
var result = {Type}()
|
||||||
if #available(OSX 10.13, iOS 11.0, tvOS 11.0, watchOS 4.0, *) {{
|
if #available(OSX 13.0, iOS 16.0, tvOS 16.0, watchOS 9.0, *) {{
|
||||||
unwrappedSource.getValue(&result, size: MemoryLayout<{Type}>.size)
|
unwrappedSource.getValue(&result, size: MemoryLayout<{Type}>.size)
|
||||||
}} else {{
|
}} else {{
|
||||||
unwrappedSource.getValue(&result)
|
unwrappedSource.getValue(&result)
|
||||||
|
|||||||
@@ -11,12 +11,15 @@
|
|||||||
import os
|
import os
|
||||||
import platform
|
import platform
|
||||||
|
|
||||||
|
|
||||||
from . import cmake
|
from . import cmake
|
||||||
from . import shell
|
from . import shell
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
from build_swift.build_swift.versions import Version
|
||||||
from build_swift.build_swift.wrappers import xcrun
|
from build_swift.build_swift.wrappers import xcrun
|
||||||
except ImportError:
|
except ImportError:
|
||||||
|
from build_swift.versions import Version
|
||||||
from build_swift.wrappers import xcrun
|
from build_swift.wrappers import xcrun
|
||||||
|
|
||||||
|
|
||||||
@@ -113,7 +116,7 @@ class DarwinPlatform(Platform):
|
|||||||
"""
|
"""
|
||||||
return self.is_embedded and not self.is_simulator
|
return self.is_embedded and not self.is_simulator
|
||||||
|
|
||||||
def sdk_supports_architecture(self, arch, toolchain):
|
def sdk_supports_architecture(self, arch, toolchain, args):
|
||||||
"""
|
"""
|
||||||
Convenience function for checking whether the SDK supports the
|
Convenience function for checking whether the SDK supports the
|
||||||
target architecture.
|
target architecture.
|
||||||
@@ -122,7 +125,8 @@ class DarwinPlatform(Platform):
|
|||||||
# The names match up with the xcrun SDK names.
|
# The names match up with the xcrun SDK names.
|
||||||
xcrun_sdk_name = self.name
|
xcrun_sdk_name = self.name
|
||||||
|
|
||||||
if (xcrun_sdk_name == 'watchos' and arch == 'armv7k'):
|
if (xcrun_sdk_name == 'watchos' and arch == 'armv7k' and
|
||||||
|
Version(args.darwin_deployment_version_watchos) < Version('9.0')):
|
||||||
return True
|
return True
|
||||||
|
|
||||||
sdk_path = xcrun.sdk_path(sdk=xcrun_sdk_name, toolchain=toolchain)
|
sdk_path = xcrun.sdk_path(sdk=xcrun_sdk_name, toolchain=toolchain)
|
||||||
|
|||||||
Reference in New Issue
Block a user