Skip to content

Commit bfa5269

Browse files
committed
[SwiftCore] Enable explicit module builds
Explicit module builds help prevent the dependency scanner from getting lost and attempting to pull the SwiftShims module from the resource directory, existing SDK, and the just-built standard library. They aren't part of the library interface, but make it possible to build the runtime libraries without seeing duplicate shims. Moving the flag to a top-level compile command.
1 parent ecc9093 commit bfa5269

File tree

2 files changed

+1
-1
lines changed

2 files changed

+1
-1
lines changed

Runtimes/Core/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ add_compile_options(
176176
add_link_options($<$<PLATFORM_ID:Windows>:LINKER:/WX>)
177177

178178
add_compile_options(
179+
$<$<COMPILE_LANGUAGE:Swift>:-explicit-module-build>
179180
"$<$<COMPILE_LANGUAGE:Swift>:-nostdlibimport>"
180181
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-library-level api>"
181182
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-runtime-compatibility-version none>"

Runtimes/Core/core/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,6 @@ target_compile_options(swiftCore PRIVATE
290290
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-enable-experimental-feature AddressableTypes>"
291291
$<$<COMPILE_LANGUAGE:Swift>:-parse-stdlib>
292292
$<$<COMPILE_LANGUAGE:Swift>:-nostdimport>
293-
$<$<COMPILE_LANGUAGE:Swift>:-explicit-module-build>
294293
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xfrontend -group-info-path -Xfrontend ${CMAKE_CURRENT_SOURCE_DIR}/GroupInfo.json>"
295294
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xfrontend -disable-objc-attr-requires-foundation-module>"
296295
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xfrontend -require-explicit-availability=ignore>")

0 commit comments

Comments
 (0)