From 290b8d3065e0a4f93594bf1baa70df3c46745ccb Mon Sep 17 00:00:00 2001 From: Rintaro Ishizaki Date: Tue, 11 Mar 2025 13:35:35 -0700 Subject: [PATCH] [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. --- cmake/modules/AddSwiftHostLibrary.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/cmake/modules/AddSwiftHostLibrary.cmake b/cmake/modules/AddSwiftHostLibrary.cmake index de65eabb184..d2f7bc69eb9 100644 --- a/cmake/modules/AddSwiftHostLibrary.cmake +++ b/cmake/modules/AddSwiftHostLibrary.cmake @@ -136,6 +136,7 @@ function(add_swift_syntax_library name) $<$: "SHELL:-module-name ${name}" "SHELL:-Xfrontend -module-abi-name -Xfrontend ${SWIFT_MODULE_ABI_NAME_PREFIX}${name}" + "-no-emit-module-separately-wmo" >) if(CMAKE_VERSION VERSION_LESS 3.26.0 AND SWIFT_SYNTAX_ENABLE_WMO_PRE_3_26)