We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 92b84e4 commit 1b79d86Copy full SHA for 1b79d86
CMakeLists.txt
@@ -35,6 +35,16 @@ if(NOT SWIFT_SYSTEM_NAME)
35
endif()
36
37
38
+# Don't enable WMO on Windows due to linker failures
39
+if(NOT CMAKE_SYSTEM_NAME STREQUAL Windows)
40
+ # Enable whole module optimization for release builds & incremental for debug builds
41
+ if(POLICY CMP0157)
42
+ set(CMAKE_Swift_COMPILATION_MODE "$<IF:$<CONFIG:Release>,wholemodule,incremental>")
43
+ else()
44
+ add_compile_options($<$<AND:$<COMPILE_LANGUAGE:Swift>,$<CONFIG:Release>>:-wmo>)
45
+ endif()
46
+endif()
47
+
48
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
49
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
50
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
0 commit comments