diff --git a/cmake/modules/AddSwift.cmake b/cmake/modules/AddSwift.cmake index d2873612366d5..1d97caa2e09bd 100644 --- a/cmake/modules/AddSwift.cmake +++ b/cmake/modules/AddSwift.cmake @@ -121,6 +121,7 @@ function(_add_host_variant_c_compile_link_flags name) _compute_lto_flag("${SWIFT_TOOLS_ENABLE_LTO}" _lto_flag_out) if (_lto_flag_out) target_compile_options(${name} PRIVATE ${_lto_flag_out}) + target_link_options(${name} PRIVATE ${_lto_flag_out}) endif() endfunction()