Skip to content

Commit ada53b1

Browse files
Merge pull request #34371 from varungandhi-apple/vg-cmake-Darwin-library-evolution
[CMake] Make sure that library evolution is set when compiling overlays.
2 parents 3b6fd4e + dd4a9f3 commit ada53b1

File tree

2 files changed

+17
-6
lines changed

2 files changed

+17
-6
lines changed

cmake/modules/StandaloneOverlay.cmake

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,17 @@ set(SWIFT_NATIVE_CLANG_TOOLS_PATH "${TOOLCHAIN_DIR}/usr/bin" CACHE STRING
5858
set(SWIFT_NATIVE_SWIFT_TOOLS_PATH "${TOOLCHAIN_DIR}/usr/bin" CACHE STRING
5959
"Path to Swift tools that are executable on the build machine.")
6060

61+
# NOTE: The initialization in stdlib/CMakeLists.txt will be bypassed if we
62+
# directly invoke CMake for this directory, so we initialize the variables
63+
# related to library evolution here as well.
64+
65+
option(SWIFT_STDLIB_STABLE_ABI
66+
"Should stdlib be built with stable ABI (library evolution, resilience)."
67+
TRUE)
68+
6169
option(SWIFT_ENABLE_MODULE_INTERFACES
6270
"Generate .swiftinterface files alongside .swiftmodule files."
63-
TRUE)
71+
"${SWIFT_STDLIB_STABLE_ABI}")
6472

6573
set(SWIFT_STDLIB_BUILD_TYPE "${CMAKE_BUILD_TYPE}" CACHE STRING
6674
"Build type for the Swift standard library and SDK overlays.")

stdlib/CMakeLists.txt

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ project(swift-stdlib LANGUAGES C CXX)
99
list(APPEND CMAKE_MODULE_PATH
1010
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules")
1111

12-
if("${SWIFT_HOST_VARIANT_SDK}" STREQUAL "OSX")
12+
if("${SWIFT_HOST_VARIANT_SDK}" MATCHES "(OSX|IOS*|TVOS*|WATCHOS*)")
1313
# All Darwin platforms have ABI stability.
1414
set(SWIFT_STDLIB_STABLE_ABI_default TRUE)
1515
elseif("${SWIFT_HOST_VARIANT_SDK}" STREQUAL "LINUX")
@@ -42,10 +42,17 @@ endif()
4242
# User-configurable options for the standard library.
4343
#
4444

45+
# NOTE: Some of these variables are also initialized in StandaloneOverlay.cmake
46+
# so that interfaces are emitted when overlays are separately built.
47+
4548
option(SWIFT_STDLIB_STABLE_ABI
4649
"Should stdlib be built with stable ABI (library evolution, resilience)."
4750
"${SWIFT_STDLIB_STABLE_ABI_default}")
4851

52+
option(SWIFT_ENABLE_MODULE_INTERFACES
53+
"Generate .swiftinterface files alongside .swiftmodule files"
54+
"${SWIFT_STDLIB_STABLE_ABI}")
55+
4956
option(SWIFT_ENABLE_COMPATIBILITY_OVERRIDES
5057
"Support back-deploying compatibility fixes for newer apps running on older runtimes."
5158
TRUE)
@@ -62,10 +69,6 @@ option(SWIFT_STDLIB_OS_VERSIONING
6269
"Build stdlib with availability based on OS versions (Darwin only)."
6370
TRUE)
6471

65-
option(SWIFT_ENABLE_MODULE_INTERFACES
66-
"Generate .swiftinterface files alongside .swiftmodule files"
67-
"${SWIFT_STDLIB_STABLE_ABI}")
68-
6972
option(SWIFT_COMPILE_DIFFERENTIATION_WITHOUT_TGMATH
7073
"Build Differentation without tgmath (and dependency on platform runtime libraries)"
7174
FALSE)

0 commit comments

Comments
 (0)