Skip to content

Commit e80b188

Browse files
authored
[build] Add LTO flag to link options (swiftlang#32683)
Following the refactoring in swiftlang#31612, LTO flag was only added to compile flags -- we need to pass this only when linking. Addresses rdar://65037856
1 parent 62eab29 commit e80b188

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

cmake/modules/AddSwift.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ function(_add_host_variant_c_compile_link_flags name)
121121
_compute_lto_flag("${SWIFT_TOOLS_ENABLE_LTO}" _lto_flag_out)
122122
if (_lto_flag_out)
123123
target_compile_options(${name} PRIVATE ${_lto_flag_out})
124+
target_link_options(${name} PRIVATE ${_lto_flag_out})
124125
endif()
125126
endfunction()
126127

0 commit comments

Comments
 (0)