diff --git a/CMakeLists.txt b/CMakeLists.txt index 9eb5c044bf96f..ff0ba86469e39 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1673,7 +1673,8 @@ if(SWIFT_ENABLE_NEW_RUNTIME_BUILD) -DCMAKE_COLOR_DIAGNOSTICS:BOOLEAN=${CMAKE_COLOR_DIAGNOSTICS} -DCMAKE_MAKE_PROGRAM=${CMAKE_MAKE_PROGRAM} -DSwiftCore_INSTALL_NESTED_SUBDIR=YES - -DSwiftCore_ENABLE_CONCURRENCY=${build_concurrency}) + -DSwiftCore_ENABLE_CONCURRENCY=${build_concurrency} + -DSwiftCore_MODULE_CACHE_PATH=${SWIFT_MODULE_CACHE_PATH}-runtimes-core) if(NOT ${CMAKE_CROSSCOMPILING}) add_dependencies("${stdlib_target}-core" swift-frontend) endif() @@ -1700,7 +1701,8 @@ if(SWIFT_ENABLE_NEW_RUNTIME_BUILD) -DCMAKE_CXX_COMPILER_TARGET:STRING=${stdlib_target_triple} -DCMAKE_COLOR_DIAGNOSTICS:BOOLEAN=${CMAKE_COLOR_DIAGNOSTICS} -DCMAKE_MAKE_PROGRAM=${CMAKE_MAKE_PROGRAM} - -DCMAKE_FIND_PACKAGE_PREFER_CONFIG=TRUE) + -DCMAKE_FIND_PACKAGE_PREFER_CONFIG=TRUE + -DSwiftOverlay_MODULE_CACHE_PATH=${SWIFT_MODULE_CACHE_PATH}-runtimes-overlay) ExternalProject_Add("${stdlib_target}-Supplemental" SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/Runtimes/Supplemental" @@ -1724,7 +1726,8 @@ if(SWIFT_ENABLE_NEW_RUNTIME_BUILD) -DCMAKE_CXX_COMPILER_TARGET:STRING=${stdlib_target_triple} -DCMAKE_COLOR_DIAGNOSTICS:BOOLEAN=${CMAKE_COLOR_DIAGNOSTICS} -DCMAKE_MAKE_PROGRAM=${CMAKE_MAKE_PROGRAM} - -DCMAKE_FIND_PACKAGE_PREFER_CONFIG=TRUE) + -DCMAKE_FIND_PACKAGE_PREFER_CONFIG=TRUE + -DSwiftSupplemental_MODULE_CACHE_PATH=${SWIFT_MODULE_CACHE_PATH}-runtimes-supplemental) endforeach() endforeach() endif() diff --git a/Runtimes/Core/CMakeLists.txt b/Runtimes/Core/CMakeLists.txt index a6428b6b425ab..f8281b4350227 100644 --- a/Runtimes/Core/CMakeLists.txt +++ b/Runtimes/Core/CMakeLists.txt @@ -194,7 +194,8 @@ add_compile_options( "$<$>,$>:SHELL:-Xfrontend -disable-objc-interop>" "$<$,$>:SHELL:-Xcc -Xclang -Xcc -fbuiltin-headers-in-system-modules>" "$<$,$>:-enable-library-evolution>" - "$<$,$>:SHELL:-Xfrontend -prespecialize-generic-metadata>") + "$<$,$>:SHELL:-Xfrontend -prespecialize-generic-metadata>" + "$<$,$>:SHELL:-module-cache-path ${SwiftCore_MODULE_CACHE_PATH}>") include(ExperimentalFeatures) diff --git a/Runtimes/Overlay/CMakeLists.txt b/Runtimes/Overlay/CMakeLists.txt index 61afeb8f6459d..367981340d51d 100644 --- a/Runtimes/Overlay/CMakeLists.txt +++ b/Runtimes/Overlay/CMakeLists.txt @@ -73,7 +73,8 @@ add_compile_options( "$<$:SHELL:-Xfrontend -enforce-exclusivity=unchecked>" "$<$:SHELL:-Xfrontend -target-min-inlining-version -Xfrontend min>" "$<$,$>:-enable-library-evolution>" - "$<$,$>:SHELL:-Xfrontend -prespecialize-generic-metadata>") + "$<$,$>:SHELL:-Xfrontend -prespecialize-generic-metadata>" + "$<$,$>:SHELL:-module-cache-path ${${PROJECT_NAME}_MODULE_CACHE_PATH}>") include(ExperimentalFeatures) diff --git a/Runtimes/Supplemental/CMakeLists.txt b/Runtimes/Supplemental/CMakeLists.txt index 0b64b98c7c7e1..8bdfffbbf5391 100644 --- a/Runtimes/Supplemental/CMakeLists.txt +++ b/Runtimes/Supplemental/CMakeLists.txt @@ -55,7 +55,8 @@ if(SwiftRuntime_ENABLE_stringprocessing) # To ensure incremental builds work as expected BUILD_ALWAYS 1 CMAKE_ARGS - ${COMMON_OPTIONS}) + ${COMMON_OPTIONS} + -DSwiftStringProcessing_MODULE_CACHE_PATH=${SwiftSupplemental_MODULE_CACHE_PATH}-stringprocessing) endif() # Synchronization @@ -68,7 +69,8 @@ if(SwiftRuntime_ENABLE_synchronization) # To ensure incremental builds work as expected BUILD_ALWAYS 1 CMAKE_ARGS - ${COMMON_OPTIONS}) + ${COMMON_OPTIONS} + -DSwiftSynchronization_MODULE_CACHE_PATH=${SwiftSupplemental_MODULE_CACHE_PATH}-synchronization) endif() # Distributed @@ -81,7 +83,8 @@ if(SwiftRuntime_ENABLE_distributed) # To ensure incremental builds work as expected BUILD_ALWAYS 1 CMAKE_ARGS - ${COMMON_OPTIONS}) + ${COMMON_OPTIONS} + -DSwiftDistributed_MODULE_CACHE_PATH=${SwiftSupplemental_MODULE_CACHE_PATH}-distributed) endif() @@ -95,7 +98,8 @@ if(SwiftRuntime_ENABLE_differentiation) # To ensure incremental builds work as expected BUILD_ALWAYS 1 CMAKE_ARGS - ${COMMON_OPTIONS}) + ${COMMON_OPTIONS} + -DSwiftDifferentiation_MODULE_CACHE_PATH=${SwiftSupplemental_MODULE_CACHE_PATH}-differentiation) endif() # Observation @@ -108,7 +112,8 @@ if(SwiftRuntime_ENABLE_observation) # To ensure incremental builds work as expected BUILD_ALWAYS 1 CMAKE_ARGS - ${COMMON_OPTIONS}) + ${COMMON_OPTIONS} + -DSwiftObservation_MODULE_CACHE_PATH=${SwiftSupplemental_MODULE_CACHE_PATH}-observation) endif() # Runtime @@ -121,5 +126,6 @@ if(SwiftRuntime_ENABLE_runtime) # To ensure incremental builds work as expected BUILD_ALWAYS 1 CMAKE_ARGS - ${COMMON_OPTIONS}) + ${COMMON_OPTIONS} + -DSwiftRuntime_MODULE_CACHE_PATH=${SwiftSupplemental_MODULE_CACHE_PATH}-runtime) endif() diff --git a/Runtimes/Supplemental/Differentiation/CMakeLists.txt b/Runtimes/Supplemental/Differentiation/CMakeLists.txt index 3e0b42124aeff..f021e6df914b1 100644 --- a/Runtimes/Supplemental/Differentiation/CMakeLists.txt +++ b/Runtimes/Supplemental/Differentiation/CMakeLists.txt @@ -75,7 +75,8 @@ add_compile_options( "$<$:SHELL:-enable-experimental-feature MemberImportVisibility>" "$<$:SHELL:-Xfrontend -enforce-exclusivity=unchecked>" "$<$:SHELL:-Xfrontend -target-min-inlining-version -Xfrontend min>" - $<$,$>:-enable-library-evolution>) + $<$,$>:-enable-library-evolution> + "$<$,$>:SHELL:-module-cache-path ${${PROJECT_NAME}_MODULE_CACHE_PATH}>") # LNK4049: symbol 'symbol' defined in 'filename.obj' is imported # LNK4286: symbol 'symbol' defined in 'filename_1.obj' is imported by 'filename_2.obj' diff --git a/Runtimes/Supplemental/Distributed/CMakeLists.txt b/Runtimes/Supplemental/Distributed/CMakeLists.txt index a802147d72c7e..e35140e9662e5 100644 --- a/Runtimes/Supplemental/Distributed/CMakeLists.txt +++ b/Runtimes/Supplemental/Distributed/CMakeLists.txt @@ -82,7 +82,8 @@ add_compile_options( "$<$:SHELL:-Xfrontend -enable-lexical-lifetimes=false>" "$<$:-warn-implicit-overrides>" "$<$,$>:-enable-library-evolution>" - "$<$,$>:SHELL:-Xfrontend -prespecialize-generic-metadata>") + "$<$,$>:SHELL:-Xfrontend -prespecialize-generic-metadata>" + "$<$,$>:SHELL:-module-cache-path ${${PROJECT_NAME}_MODULE_CACHE_PATH}>") # LNK4049: symbol 'symbol' defined in 'filename.obj' is imported # LNK4286: symbol 'symbol' defined in 'filename_1.obj' is imported by 'filename_2.obj' diff --git a/Runtimes/Supplemental/Observation/CMakeLists.txt b/Runtimes/Supplemental/Observation/CMakeLists.txt index 98ce40a292f5e..444f7ef8953c4 100644 --- a/Runtimes/Supplemental/Observation/CMakeLists.txt +++ b/Runtimes/Supplemental/Observation/CMakeLists.txt @@ -80,7 +80,8 @@ add_compile_options( "$<$:SHELL:-Xfrontend -enable-lexical-lifetimes=false>" "$<$:-warn-implicit-overrides>" "$<$,$>:-enable-library-evolution>" - "$<$,$>:SHELL:-Xfrontend -prespecialize-generic-metadata>") + "$<$,$>:SHELL:-Xfrontend -prespecialize-generic-metadata>" + "$<$,$>:SHELL:-module-cache-path ${${PROJECT_NAME}_MODULE_CACHE_PATH}>") # LNK4049: symbol 'symbol' defined in 'filename.obj' is imported # LNK4286: symbol 'symbol' defined in 'filename_1.obj' is imported by 'filename_2.obj' diff --git a/Runtimes/Supplemental/Runtime/CMakeLists.txt b/Runtimes/Supplemental/Runtime/CMakeLists.txt index 099fa4945bea2..1d03c15b7181d 100644 --- a/Runtimes/Supplemental/Runtime/CMakeLists.txt +++ b/Runtimes/Supplemental/Runtime/CMakeLists.txt @@ -89,7 +89,8 @@ add_compile_options( "$<$:-cxx-interoperability-mode=default>" "$<$:SHELL:-Xfrontend -experimental-spi-only-imports>" "$<$,$>:-enable-library-evolution>" - "$<$,$>:SHELL:-Xfrontend -prespecialize-generic-metadata>") + "$<$,$>:SHELL:-Xfrontend -prespecialize-generic-metadata>" + "$<$,$>:SHELL:-module-cache-path ${${PROJECT_NAME}_MODULE_CACHE_PATH}>") # LNK4049: symbol 'symbol' defined in 'filename.obj' is imported # LNK4286: symbol 'symbol' defined in 'filename_1.obj' is imported by 'filename_2.obj' diff --git a/Runtimes/Supplemental/StringProcessing/CMakeLists.txt b/Runtimes/Supplemental/StringProcessing/CMakeLists.txt index 709ba16918411..837ff1a76b9b7 100644 --- a/Runtimes/Supplemental/StringProcessing/CMakeLists.txt +++ b/Runtimes/Supplemental/StringProcessing/CMakeLists.txt @@ -57,7 +57,8 @@ add_compile_options( "$<$:SHELL:-Xfrontend -disable-implicit-string-processing-module-import>" "$<$:-warn-implicit-overrides>" "$<$,$>:-enable-library-evolution>" - "$<$,$>:SHELL:-Xfrontend -prespecialize-generic-metadata>") + "$<$,$>:SHELL:-Xfrontend -prespecialize-generic-metadata>" + "$<$,$>:SHELL:-module-cache-path ${${PROJECT_NAME}_MODULE_CACHE_PATH}>") # LNK4049: symbol 'symbol' defined in 'filename.obj' is imported # LNK4286: symbol 'symbol' defined in 'filename_1.obj' is imported by 'filename_2.obj' diff --git a/Runtimes/Supplemental/Synchronization/CMakeLists.txt b/Runtimes/Supplemental/Synchronization/CMakeLists.txt index 2ab0500c53d94..e28b156205fba 100644 --- a/Runtimes/Supplemental/Synchronization/CMakeLists.txt +++ b/Runtimes/Supplemental/Synchronization/CMakeLists.txt @@ -93,7 +93,8 @@ add_compile_options( "$<$:SHELL:-Xfrontend -enable-lexical-lifetimes=false>" "$<$:-warn-implicit-overrides>" "$<$,$>:-enable-library-evolution>" - "$<$,$>:SHELL:-Xfrontend -prespecialize-generic-metadata>") + "$<$,$>:SHELL:-Xfrontend -prespecialize-generic-metadata>" + "$<$,$>:SHELL:-module-cache-path ${${PROJECT_NAME}_MODULE_CACHE_PATH}>") # LNK4049: symbol 'symbol' defined in 'filename.obj' is imported # LNK4286: symbol 'symbol' defined in 'filename_1.obj' is imported by 'filename_2.obj' diff --git a/Runtimes/Supplemental/Volatile/CMakeLists.txt b/Runtimes/Supplemental/Volatile/CMakeLists.txt index ad8fc2428852a..d97a5c38f3dd0 100644 --- a/Runtimes/Supplemental/Volatile/CMakeLists.txt +++ b/Runtimes/Supplemental/Volatile/CMakeLists.txt @@ -68,7 +68,8 @@ add_compile_options( $<$:-nostdlibimport> $<$:-strict-memory-safety> "$<$,$>:-enable-library-evolution>" - "$<$,$>:SHELL:-Xfrontend -prespecialize-generic-metadata>") + "$<$,$>:SHELL:-Xfrontend -prespecialize-generic-metadata>" + "$<$,$>:SHELL:-module-cache-path ${${PROJECT_NAME}_MODULE_CACHE_PATH}>") # LNK4049: symbol 'symbol' defined in 'filename.obj' is imported # LNK4286: symbol 'symbol' defined in 'filename_1.obj' is imported by 'filename_2.obj'