Skip to content

Commit 17db23b

Browse files
committed
[Runtimes] Enable overlay builds in macOS smoketest
Take the chance to match the flags used in the existing build system, and adjust code ownership to cover the file I added to track the experimental flags for the overlays. Addresses rdar://155882420
1 parent a4ad806 commit 17db23b

File tree

5 files changed

+49
-3
lines changed

5 files changed

+49
-3
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
/Runtimes/**/*.cmake @etcwilde @compnerd @edymtt @justice-adams-apple
3737
/Runtimes/**/CMakeLists.txt @etcwilde @compnerd @edymtt @justice-adams-apple
3838
/Runtimes/Core/cmake/caches/Vendors/Apple/ @etcwilde @shahmishal @edymtt @justice-adams-apple
39-
/Runtimes/Core/cmake/modules/ExperimentalFeatures.cmake @tshortli @etcwilde @compnerd @edymtt @justice-adams-apple
39+
/Runtimes/*/cmake/modules/ExperimentalFeatures.cmake @tshortli @etcwilde @compnerd @edymtt @justice-adams-apple
4040

4141
# SwiftCompilerSources
4242
/SwiftCompilerSources @eeckstein

CMakeLists.txt

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1653,9 +1653,31 @@ if(SWIFT_ENABLE_NEW_RUNTIME_BUILD)
16531653

16541654
ExternalProject_Get_Property("${stdlib_target}-core" INSTALL_DIR)
16551655

1656+
ExternalProject_Add("${stdlib_target}-Overlay"
1657+
SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/Runtimes/Overlay"
1658+
DEPENDS "${stdlib_target}-core"
1659+
INSTALL_DIR "${INSTALL_DIR}"
1660+
LIST_SEPARATOR "|"
1661+
# To ensure incremental builds work as expected
1662+
BUILD_ALWAYS 1
1663+
CMAKE_ARGS
1664+
-DBUILD_SHARED_LIBS=YES
1665+
-DCMAKE_Swift_COMPILER_WORKS:BOOLEAN=YES
1666+
-DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
1667+
-DCMAKE_INSTALL_PREFIX:FILEPATH=${INSTALL_DIR}
1668+
-DCMAKE_Swift_COMPILER:FILEPATH=$<IF:$<BOOL:${CMAKE_CROSSCOMPILING}>,${CMAKE_Swift_COMPILER},$<PATH:REPLACE_FILENAME,$<TARGET_FILE:swift-frontend>,swiftc>>
1669+
-DCMAKE_C_COMPILER:FILEPATH=${CMAKE_C_COMPILER}
1670+
-DCMAKE_CXX_COMPILER:FILEPATH=${CMAKE_CXX_COMPILER}
1671+
-DCMAKE_Swift_COMPILER_TARGET:STRING=${stdlib_target_triple}
1672+
-DCMAKE_C_COMPILER_TARGET:STRING=${stdlib_target_triple}
1673+
-DCMAKE_CXX_COMPILER_TARGET:STRING=${stdlib_target_triple}
1674+
-DCMAKE_COLOR_DIAGNOSTICS:BOOLEAN=${CMAKE_COLOR_DIAGNOSTICS}
1675+
-DCMAKE_MAKE_PROGRAM=${CMAKE_MAKE_PROGRAM}
1676+
-DCMAKE_FIND_PACKAGE_PREFER_CONFIG=TRUE)
1677+
16561678
ExternalProject_Add("${stdlib_target}-Supplemental"
16571679
SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/Runtimes/Supplemental"
1658-
DEPENDS "${stdlib_target}-core"
1680+
DEPENDS "${stdlib_target}-core" "${stdlib_target}-Overlay"
16591681
INSTALL_DIR "${INSTALL_DIR}"
16601682
INSTALL_COMMAND ""
16611683
LIST_SEPARATOR "|"

Runtimes/Overlay/CMakeLists.txt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ project(SwiftOverlay
3131
LANGUAGES C CXX Swift
3232
VERSION 6.1.0${BUILD_NUMBER})
3333

34+
set(CMAKE_Swift_LANGUAGE_VERSION 5)
35+
3436
find_package(SwiftCore)
3537

3638
# FIXME: We should not need to refer back into the compiler sources. This is
@@ -55,10 +57,22 @@ option(SwiftOverlay_INSTALL_NESTED_SUBDIR "Install libraries under a platform an
5557
set(SwiftOverlay_INSTALL_LIBDIR "${CMAKE_INSTALL_LIBDIR}/swift$<$<NOT:$<BOOL:${BUILD_SHARED_LIBS}>>:_static>$<$<BOOL:${SwiftOverlay_INSTALL_NESTED_SUBDIR}>:/${SwiftOverlay_PLATFORM_SUBDIR}/${SwiftOverlay_ARCH_SUBDIR}>")
5658
set(SwiftOverlay_INSTALL_SWIFTMODULEDIR "${CMAKE_INSTALL_LIBDIR}/swift$<$<NOT:$<BOOL:${BUILD_SHARED_LIBS}>>:_static>$<$<BOOL:${SwiftOverlay_INSTALL_NESTED_SUBDIR}>:/${SwiftOverlay_PLATFORM_SUBDIR}>")
5759

60+
option(SwiftOverlay_ENABLE_LIBRARY_EVOLUTION "Generate ABI resilient runtime libraries"
61+
${SwiftCore_ENABLE_LIBRARY_EVOLUTION})
62+
5863
add_compile_options(
64+
$<$<COMPILE_LANGUAGE:Swift>:-explicit-module-build>
65+
$<$<COMPILE_LANGUAGE:Swift>:-nostdlibimport>
66+
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xfrontend -enforce-exclusivity=unchecked>"
67+
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xfrontend -target-min-inlining-version -Xfrontend min>"
68+
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xfrontend -enable-lexical-lifetimes=false>"
69+
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xfrontend -enable-ossa-modules>"
70+
"$<$<AND:$<BOOL:${SwiftOverlay_ENABLE_LIBRARY_EVOLUTION}>,$<COMPILE_LANGUAGE:Swift>>:-enable-library-evolution>"
5971
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xfrontend -disable-implicit-concurrency-module-import>"
6072
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xfrontend -disable-implicit-string-processing-module-import>")
6173

74+
include(ExperimentalFeatures)
75+
6276
add_subdirectory(clang)
6377
if(ANDROID)
6478
add_subdirectory(Android)

Runtimes/Overlay/clang/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ add_library(swift_Builtin_float
77
set_target_properties(swift_Builtin_float PROPERTIES
88
Swift_MODULE_NAME _Builtin_float)
99
target_compile_options(swift_Builtin_float PRIVATE
10-
"$<$<PLATFORM_ID:Darwin>:SHELL:-Xfrontend -module-abi-name -Xfrontend Darwin>")
10+
"$<$<AND:$<PLATFORM_ID:Darwin>,$<COMPILE_LANGUAGE:Swift>>:SHELL:-Xfrontend -module-abi-name -Xfrontend Darwin>"
11+
$<$<COMPILE_LANGUAGE:Swift>:-autolink-force-load>)
1112
target_link_libraries(swift_Builtin_float PRIVATE
1213
$<$<PLATFORM_ID:Windows>:ClangModules>
1314
swiftCore)
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
add_compile_options(
2+
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-enable-experimental-feature NoncopyableGenerics2>"
3+
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-enable-experimental-feature SuppressedAssociatedTypes>"
4+
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-enable-experimental-feature SE427NoInferenceOnExtension>"
5+
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-enable-experimental-feature NonescapableTypes>"
6+
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-enable-experimental-feature LifetimeDependence>"
7+
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-enable-experimental-feature InoutLifetimeDependence>"
8+
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-enable-experimental-feature LifetimeDependenceMutableAccessors>"
9+
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-enable-upcoming-feature MemberImportVisibility>")

0 commit comments

Comments
 (0)