Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib/${SWIFT_HOST_LIBRARI

set(CMAKE_MACOSX_RPATH YES)

option(SWIFT_SYNTAX_ENABLE_WMO_PRE_3_26
"Enable Whole Module Optimization (WMO) - requires swift-driver"
$<IF:$<AND:$<NOT:$<CONFIG:Debug>>,$<PLATFORM_ID:Darwin>>,YES,NO>)

include(AddSwiftHostLibrary)

# Ensure that we do not link the _StringProcessing module. But we can
Expand Down
6 changes: 2 additions & 4 deletions cmake/modules/AddSwiftHostLibrary.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,9 @@ function(add_swift_host_library name)
-emit-module-interface-path;${module_interface_file}
>)

if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
if(CMAKE_VERSION VERSION_LESS 3.26.0 AND SWIFT_SYNTAX_ENABLE_WMO_PRE_3_26)
target_compile_options(${name} PRIVATE
$<$<COMPILE_LANGUAGE:Swift>:
-wmo
>)
$<$<COMPILE_LANGUAGE:Swift>:-wmo>)
endif()

# NOTE: workaround for CMake not setting up include flags yet
Expand Down