Skip to content

Commit 87bcd87

Browse files
committed
[cmake] fix for maccatalyst builds
In some build configurations, libswiftCompatibilitySpan was being linked for a newer deployment target than expected.
1 parent a69dbb3 commit 87bcd87

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

stdlib/toolchain/CompatibilitySpan/CMakeLists.txt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND DEFINED SWIFT_STDLIB_LIBRARY_BUILD_TY
22

33
set(library_name "swiftCompatibilitySpan")
44

5+
# The correct fix would be to add this to the following to the invocation of add_swift_target_library
6+
# DEPLOYMENT_VERSION_MACCATALYST ${COMPATIBILITY_MINIMUM_DEPLOYMENT_VERSION_MACCATALYST}
7+
# but the underlying logic takes the deployment version from the cache instead
8+
# so for now we override those values locally
9+
set(SWIFT_DARWIN_DEPLOYMENT_VERSION_OSX ${COMPATIBILITY_MINIMUM_DEPLOYMENT_VERSION_OSX})
10+
set(SWIFT_DARWIN_DEPLOYMENT_VERSION_MACCATALYST ${COMPATIBILITY_MINIMUM_DEPLOYMENT_VERSION_MACCATALYST})
11+
512
add_swift_target_library("${library_name}" ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_STDLIB
613
FakeStdlib.swift
714
../../public/core/Span/MutableRawSpan.swift
@@ -13,8 +20,6 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND DEFINED SWIFT_STDLIB_LIBRARY_BUILD_TY
1320

1421
TARGET_SDKS ${SWIFT_APPLE_PLATFORMS}
1522

16-
LINK_FLAGS "${SWIFT_RUNTIME_SWIFT_LINK_FLAGS}"
17-
1823
SWIFT_COMPILE_FLAGS
1924
${SWIFT_STANDARD_LIBRARY_SWIFT_FLAGS}
2025
-parse-stdlib

0 commit comments

Comments
 (0)