Skip to content

Commit 6f782d9

Browse files
authored
Merge pull request #1692 from bnbarham/use-release-wmo
[CMake] Use WMO for release builds
2 parents bf18c71 + d9d09e8 commit 6f782d9

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

cmake/modules/AddSwiftHostLibrary.cmake

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,13 @@ function(add_swift_host_library name)
5656
-emit-module-interface-path;${module_interface_file}
5757
>)
5858

59+
if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
60+
target_compile_options(${name} PRIVATE
61+
$<$<COMPILE_LANGUAGE:Swift>:
62+
-wmo
63+
>)
64+
endif()
65+
5966
# NOTE: workaround for CMake not setting up include flags yet
6067
set_target_properties(${name} PROPERTIES
6168
INTERFACE_INCLUDE_DIRECTORIES ${module_dir}

0 commit comments

Comments
 (0)