mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Merge pull request #75914 from benlangmuir/turn-it-up-to-11
Bump the deployment target for the compiler to macOS 13.0
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."
|
||||
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")
|
||||
|
||||
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")
|
||||
|
||||
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")
|
||||
|
||||
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")
|
||||
|
||||
set(SWIFT_DARWIN_DEPLOYMENT_VERSION_XROS "1.0" CACHE STRING
|
||||
|
||||
@@ -110,10 +110,10 @@ macro(configure_sdks_darwin)
|
||||
set(appletvos_arch "arm64")
|
||||
set(watchos_arch "armv7k" "arm64_32")
|
||||
|
||||
set(macosx_ver "10.13")
|
||||
set(iphoneos_ver "11.0")
|
||||
set(appletvos_ver "11.0")
|
||||
set(watchos_ver "4.0")
|
||||
set(macosx_ver "13.0")
|
||||
set(iphoneos_ver "16.0")
|
||||
set(appletvos_ver "16.0")
|
||||
set(watchos_ver "9.0")
|
||||
|
||||
set(macosx_vendor "apple")
|
||||
set(iphoneos_vendor "apple")
|
||||
|
||||
@@ -68,7 +68,7 @@ function(_report_sdk prefix)
|
||||
endfunction()
|
||||
|
||||
# Remove architectures not supported by the SDK from the given list.
|
||||
function(remove_sdk_unsupported_archs name os sdk_path architectures_var)
|
||||
function(remove_sdk_unsupported_archs name os sdk_path deployment_version architectures_var)
|
||||
execute_process(COMMAND
|
||||
/usr/libexec/PlistBuddy -c "Print :SupportedTargets:${os}:Archs" ${sdk_path}/SDKSettings.plist
|
||||
OUTPUT_VARIABLE sdk_supported_archs
|
||||
@@ -87,11 +87,11 @@ function(remove_sdk_unsupported_archs name os sdk_path architectures_var)
|
||||
# 32-bit iOS simulator is not listed explicitly in SDK settings.
|
||||
message(STATUS "Assuming ${name} SDK at ${sdk_path} supports architecture ${arch}")
|
||||
list(APPEND architectures ${arch})
|
||||
elseif(arch STREQUAL "armv7k" AND os STREQUAL "watchos")
|
||||
elseif(arch STREQUAL "armv7k" AND os STREQUAL "watchos" AND deployment_version VERSION_LESS "9.0")
|
||||
# 32-bit watchOS is not listed explicitly in SDK settings.
|
||||
message(STATUS "Assuming ${name} SDK at ${sdk_path} supports architecture ${arch}")
|
||||
list(APPEND architectures ${arch})
|
||||
elseif(arch STREQUAL "i386" AND os STREQUAL "watchsimulator")
|
||||
elseif(arch STREQUAL "i386" AND os STREQUAL "watchsimulator" AND deployment_version VERSION_LESS "7.0")
|
||||
# 32-bit watchOS simulator is not listed explicitly in SDK settings.
|
||||
message(STATUS "Assuming ${name} SDK at ${sdk_path} supports architecture ${arch}")
|
||||
list(APPEND architectures ${arch})
|
||||
@@ -229,7 +229,7 @@ macro(configure_sdk_darwin
|
||||
endif()
|
||||
|
||||
# Remove any architectures not supported by the SDK.
|
||||
remove_sdk_unsupported_archs(${name} ${xcrun_name} ${SWIFT_SDK_${prefix}_PATH} SWIFT_SDK_${prefix}_ARCHITECTURES)
|
||||
remove_sdk_unsupported_archs(${name} ${xcrun_name} ${SWIFT_SDK_${prefix}_PATH} "${SWIFT_SDK_${prefix}_DEPLOYMENT_VERSION}" SWIFT_SDK_${prefix}_ARCHITECTURES)
|
||||
|
||||
list_intersect(
|
||||
"${SWIFT_DARWIN_MODULE_ARCHS}" # lhs
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
// REQUIRES: OS=macosx
|
||||
|
||||
import OpenGL.GL3
|
||||
_ = glGetString
|
||||
_ = OpenGL.glGetString
|
||||
_ = glGetString // expected-warning * {{'glGetString' was deprecated}}
|
||||
_ = OpenGL.glGetString // expected-warning * {{'glGetString' was deprecated}}
|
||||
_ = GL_COLOR_BUFFER_BIT
|
||||
_ = OpenGL.GL_COLOR_BUFFER_BIT
|
||||
|
||||
|
||||
@@ -4,9 +4,9 @@ config.substitutions = list(config.substitutions)
|
||||
if config.target_sdk_name == 'macosx':
|
||||
def do_fixup(key, value):
|
||||
if isinstance(value, str):
|
||||
value = value.replace("-apple-macosx10.13", "-apple-macos14")
|
||||
value = value.replace("-apple-macosx13.0", "-apple-macos14")
|
||||
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)
|
||||
|
||||
config.substitutions = [do_fixup(a, b) for (a, b) in config.substitutions]
|
||||
|
||||
@@ -41,7 +41,7 @@ func test_NSCoder_decodeTopLevelObjectOfClasses_forKey_error(
|
||||
|
||||
|
||||
func test_NSKeyedUnarchiver_unarchiveObjectWithData(_ data: NSData) {
|
||||
var r = NSKeyedUnarchiver.unarchiveObject(with: data as Data)
|
||||
var r = NSKeyedUnarchiver.unarchiveObject(with: data as Data) // expected-warning * {{'unarchiveObject(with:)' was deprecated}}
|
||||
expectType(Optional<Any>.self, &r)
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
// RUN: %empty-directory(%t)
|
||||
//
|
||||
// RUN: %target-clang %S/Inputs/Mirror/Mirror.mm -c -o %t/Mirror.mm.o -g
|
||||
// RUN: %target-build-swift -parse-stdlib %s -module-name Reflection -I %S/Inputs/Mirror/ -Xlinker %t/Mirror.mm.o -o %t/a.out
|
||||
// Note: explicitly link the CoreGraphics overlay because does not get autolinked
|
||||
// and it is needed for conformances on macOS < 15.
|
||||
// RUN: %target-build-swift -parse-stdlib %s -module-name Reflection -I %S/Inputs/Mirror/ -Xlinker %t/Mirror.mm.o -o %t/a.out -lswiftCoreGraphics
|
||||
// RUN: %target-codesign %t/a.out
|
||||
// RUN: %{python} %S/../Inputs/timeout.py 360 %target-run %t/a.out %S/Inputs/shuffle.jpg | %FileCheck %s
|
||||
// FIXME: timeout wrapper is necessary because the ASan test runs for hours
|
||||
|
||||
@@ -699,7 +699,7 @@ build-ninja
|
||||
# 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
|
||||
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
|
||||
skip-build-swift
|
||||
|
||||
@@ -424,7 +424,7 @@ def apply_default_arguments(toolchain, args):
|
||||
for target in targets
|
||||
if (not target.platform.is_darwin or
|
||||
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.
|
||||
|
||||
@@ -101,10 +101,10 @@ KNOWN_SETTINGS=(
|
||||
|
||||
## Darwin Options
|
||||
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-osx "10.13" "minimum deployment target version for OS X"
|
||||
darwin-deployment-version-tvos "11.0" "minimum deployment target version for tvOS"
|
||||
darwin-deployment-version-watchos "4.0" "minimum deployment target version for watchOS"
|
||||
darwin-deployment-version-ios "16.0" "minimum deployment target version for iOS"
|
||||
darwin-deployment-version-osx "13.0" "minimum deployment target version for OS X"
|
||||
darwin-deployment-version-tvos "16.0" "minimum deployment target version for tvOS"
|
||||
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-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"
|
||||
|
||||
@@ -52,10 +52,10 @@ CLANG_USER_VISIBLE_VERSION = Version('17.0.0')
|
||||
SWIFT_ANALYZE_CODE_COVERAGE = 'false'
|
||||
|
||||
DARWIN_XCRUN_TOOLCHAIN = 'default'
|
||||
DARWIN_DEPLOYMENT_VERSION_OSX = '10.13'
|
||||
DARWIN_DEPLOYMENT_VERSION_IOS = '11.0'
|
||||
DARWIN_DEPLOYMENT_VERSION_TVOS = '11.0'
|
||||
DARWIN_DEPLOYMENT_VERSION_WATCHOS = '4.0'
|
||||
DARWIN_DEPLOYMENT_VERSION_OSX = '13.0'
|
||||
DARWIN_DEPLOYMENT_VERSION_IOS = '16.0'
|
||||
DARWIN_DEPLOYMENT_VERSION_TVOS = '16.0'
|
||||
DARWIN_DEPLOYMENT_VERSION_WATCHOS = '9.0'
|
||||
DARWIN_DEPLOYMENT_VERSION_XROS = '1.0'
|
||||
|
||||
UNIX_INSTALL_PREFIX = '/usr'
|
||||
|
||||
@@ -12,7 +12,7 @@ extension {Type}: _ObjectiveCBridgeable {{
|
||||
_getObjCTypeEncoding({Type}.self)) == 0,
|
||||
"NSValue does not contain the right type to bridge to {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)
|
||||
}} else {{
|
||||
source.getValue(&result!)
|
||||
@@ -27,7 +27,7 @@ extension {Type}: _ObjectiveCBridgeable {{
|
||||
return false
|
||||
}}
|
||||
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)
|
||||
}} else {{
|
||||
source.getValue(&result!)
|
||||
@@ -42,7 +42,7 @@ extension {Type}: _ObjectiveCBridgeable {{
|
||||
_getObjCTypeEncoding({Type}.self)) == 0,
|
||||
"NSValue does not contain the right type to bridge to {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)
|
||||
}} else {{
|
||||
unwrappedSource.getValue(&result)
|
||||
|
||||
@@ -11,12 +11,15 @@
|
||||
import os
|
||||
import platform
|
||||
|
||||
|
||||
from . import cmake
|
||||
from . import shell
|
||||
|
||||
try:
|
||||
from build_swift.build_swift.versions import Version
|
||||
from build_swift.build_swift.wrappers import xcrun
|
||||
except ImportError:
|
||||
from build_swift.versions import Version
|
||||
from build_swift.wrappers import xcrun
|
||||
|
||||
|
||||
@@ -113,7 +116,7 @@ class DarwinPlatform(Platform):
|
||||
"""
|
||||
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
|
||||
target architecture.
|
||||
@@ -122,7 +125,8 @@ class DarwinPlatform(Platform):
|
||||
# The names match up with the xcrun SDK names.
|
||||
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
|
||||
|
||||
sdk_path = xcrun.sdk_path(sdk=xcrun_sdk_name, toolchain=toolchain)
|
||||
|
||||
Reference in New Issue
Block a user