Skip to content

Commit 74d4917

Browse files
authored
Merge pull request #78477 from etcwilde/ewilde/macos-smoketest-enable-new-build
Enable new stdlib build in macOS smoke tests
2 parents f2ddef7 + e0e418f commit 74d4917

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

CMakeLists.txt

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1577,6 +1577,7 @@ endif()
15771577
# New standard library build
15781578
option(SWIFT_ENABLE_NEW_RUNTIME_BUILD "Build Swift runtimes with new build system" OFF)
15791579
if(SWIFT_ENABLE_NEW_RUNTIME_BUILD)
1580+
message(STATUS "New runtime build enabled")
15801581

15811582
add_custom_target(PopulateRuntimeSourceDir
15821583
COMMAND "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_SOURCE_DIR}/Runtimes/Resync.cmake"
@@ -1593,6 +1594,12 @@ if(SWIFT_ENABLE_NEW_RUNTIME_BUILD)
15931594
if(${SWIFT_SDK_${sdk}_${arch}_CACHE})
15941595
set(stdlib_cache_file_flag -C ${SWIFT_SDK_${sdk}_${arch}_CACHE})
15951596
endif()
1597+
1598+
set(stdlib_target_triple ${SWIFT_SDK_${sdk}_ARCH_${arch}_TRIPLE})
1599+
if(SWIFT_SDK_${sdk}_DEPLOYMENT_VERSION)
1600+
string(APPEND stdlib_target_triple ${SWIFT_SDK_${sdk}_DEPLOYMENT_VERSION})
1601+
endif()
1602+
15961603
ExternalProject_Add("${stdlib_target}-core"
15971604
SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/Runtimes/Core"
15981605
# TODO: Add this once we're ready to start swapping out the libraries
@@ -1611,8 +1618,13 @@ if(SWIFT_ENABLE_NEW_RUNTIME_BUILD)
16111618
-DCMAKE_Swift_COMPILER:FILEPATH=$<IF:$<BOOL:${CMAKE_CROSSCOMPILING}>,${CMAKE_Swift_COMPILER},$<PATH:REPLACE_FILENAME,$<TARGET_FILE:swift-frontend>,swiftc>>
16121619
-DCMAKE_C_COMPILER:FILEPATH=${CMAKE_C_COMPILER}
16131620
-DCMAKE_CXX_COMPILER:FILEPATH=${CMAKE_CXX_COMPILER}
1621+
-DCMAKE_Swift_COMPILER_TARGET:STRING=${stdlib_target_triple}
1622+
-DCMAKE_C_COMPILER_TARGET:STRING=${stdlib_target_triple}
1623+
-DCMAKE_CXX_COMPILER_TARGET:STRING=${stdlib_target_triple}
16141624
-DCMAKE_COLOR_DIAGNOSTICS:BOOLEAN=${CMAKE_COLOR_DIAGNOSTICS}
1615-
-DCMAKE_MAKE_PROGRAM=${CMAKE_MAKE_PROGRAM})
1625+
-DCMAKE_MAKE_PROGRAM=${CMAKE_MAKE_PROGRAM}
1626+
-DSwiftCore_PLATFORM_SUBDIR=${SWIFT_SDK_${sdk}_LIB_SUBDIR}
1627+
-DSwiftCore_ARCH_SUBDIR=${arch})
16161628
if(NOT ${CMAKE_CROSSCOMPILING})
16171629
add_dependencies("${stdlib_target}" swift-frontend)
16181630
endif()

utils/build-presets.ini

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -669,6 +669,8 @@ skip-test-sourcekit-lsp
669669
skip-test-swiftpm
670670
skip-test-llbuild
671671

672+
swift-cmake-options=-DSWIFT_ENABLE_NEW_RUNTIME_BUILD=YES
673+
672674
[preset: buildbot_incremental,tools=RA,stdlib=RD,smoketest=macosx,flto]
673675
mixin-preset=buildbot_incremental,tools=RA,stdlib=RD,smoketest=macosx
674676
build-subdir=buildbot_incremental

0 commit comments

Comments
 (0)