Skip to content

Commit 290b8d3

Browse files
committed
[CMake] '-no-emit-module-separately-wmo' for swift modules
Emitting modules in separate frontend job doesn't give any benefits because single add_library is just a single job from CMake's point of view. Clients need to wait for `.dylib`/`.so` being emitted before using the `.swiftmodule`. *Not* emitting modules separately is actually faster in CMake because it doesn't parse and typecheck the source code twice.
1 parent 2e0d555 commit 290b8d3

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

cmake/modules/AddSwiftHostLibrary.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ function(add_swift_syntax_library name)
136136
$<$<COMPILE_LANGUAGE:Swift>:
137137
"SHELL:-module-name ${name}"
138138
"SHELL:-Xfrontend -module-abi-name -Xfrontend ${SWIFT_MODULE_ABI_NAME_PREFIX}${name}"
139+
"-no-emit-module-separately-wmo"
139140
>)
140141

141142
if(CMAKE_VERSION VERSION_LESS 3.26.0 AND SWIFT_SYNTAX_ENABLE_WMO_PRE_3_26)

0 commit comments

Comments
 (0)