[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
This commit is contained in:
Eric Miotto
2025-07-10 14:04:09 -07:00
parent 2edec10efe
commit 41e48f867e
2 changed files with 8 additions and 0 deletions

View File

@@ -1626,6 +1626,8 @@ if(SWIFT_ENABLE_NEW_RUNTIME_BUILD)
# INSTALL_DIR "${CMAKE_BINARY_DIR}/"
DEPENDS PopulateRuntimeSourceDir
# To ensure incremental builds work as expected
BUILD_ALWAYS 1
CMAKE_ARGS
-DCMAKE_INSTALL_LIBDIR:FILEPATH=lib
# Compiler will see mismatched swift modules and fail initial checks
@@ -1657,6 +1659,8 @@ if(SWIFT_ENABLE_NEW_RUNTIME_BUILD)
INSTALL_DIR "${INSTALL_DIR}"
INSTALL_COMMAND ""
LIST_SEPARATOR "|"
# To ensure incremental builds work as expected
BUILD_ALWAYS 1
CMAKE_ARGS
-DSwift_ENABLE_RUNTIMES=StringProcessing
-DBUILD_SHARED_LIBS=YES