Skip to content

Commit 41e48f8

Browse files
committed
[CMake] Ensure incremental builds invokes the Runtimes build system...
...when using `--enable-new-runtime-build` When building changes incrementally the runtime build system is not invoked -- the configure and build steps generated by `ExternalProject_Add` are effectively triggered only if the `CMAKE_ARGS` argument changes. We should instead delegate to the the Runtime build system to figure out if it needs to regenerate the `build.ninja` file and/or trigger any rebuild -- this can be done by passing `BUILD_ALWAYS 1` to `ExternalProject_Add`. Addresses rdar://155559208
1 parent 2edec10 commit 41e48f8

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1626,6 +1626,8 @@ if(SWIFT_ENABLE_NEW_RUNTIME_BUILD)
16261626
# INSTALL_DIR "${CMAKE_BINARY_DIR}/"
16271627

16281628
DEPENDS PopulateRuntimeSourceDir
1629+
# To ensure incremental builds work as expected
1630+
BUILD_ALWAYS 1
16291631
CMAKE_ARGS
16301632
-DCMAKE_INSTALL_LIBDIR:FILEPATH=lib
16311633
# Compiler will see mismatched swift modules and fail initial checks
@@ -1657,6 +1659,8 @@ if(SWIFT_ENABLE_NEW_RUNTIME_BUILD)
16571659
INSTALL_DIR "${INSTALL_DIR}"
16581660
INSTALL_COMMAND ""
16591661
LIST_SEPARATOR "|"
1662+
# To ensure incremental builds work as expected
1663+
BUILD_ALWAYS 1
16601664
CMAKE_ARGS
16611665
-DSwift_ENABLE_RUNTIMES=StringProcessing
16621666
-DBUILD_SHARED_LIBS=YES

Runtimes/Supplemental/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ if(SwiftRuntime_ENABLE_stringprocessing)
5151
SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/StringProcessing"
5252
INSTALL_DIR "${CMAKE_INSTALL_PREFIX}"
5353
INSTALL_COMMAND ""
54+
# To ensure incremental builds work as expected
55+
BUILD_ALWAYS 1
5456
CMAKE_ARGS
5557
${COMMON_OPTIONS})
5658
endif()
@@ -62,6 +64,8 @@ if(SwiftRuntime_ENABLE_synchronization)
6264
SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/Synchronization"
6365
INSTALL_DIR "${CMAKE_INSTALL_PREFIX}"
6466
INSTALL_COMMAND ""
67+
# To ensure incremental builds work as expected
68+
BUILD_ALWAYS 1
6569
CMAKE_ARGS
6670
${COMMON_OPTIONS})
6771
endif()

0 commit comments

Comments
 (0)