We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 253786c commit 121137cCopy full SHA for 121137c
CMakeLists.txt
@@ -41,6 +41,16 @@ if(NOT SWIFT_SYSTEM_NAME)
41
endif()
42
43
44
+# Don't enable WMO on Windows due to linker failures
45
+if(NOT CMAKE_SYSTEM_NAME STREQUAL Windows)
46
+ # Enable whole module optimization for release builds & incremental for debug builds
47
+ if(POLICY CMP0157)
48
+ set(CMAKE_Swift_COMPILATION_MODE "$<IF:$<CONFIG:Release>,wholemodule,incremental>")
49
+ else()
50
+ add_compile_options($<$<AND:$<COMPILE_LANGUAGE:Swift>,$<CONFIG:Release>>:-wmo>)
51
+ endif()
52
+endif()
53
+
54
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
55
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
56
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
0 commit comments