diff --git a/CMLibCommonTargetProperties.cmake b/CMLibCommonTargetProperties.cmake index ac24f19..2e64c79 100644 --- a/CMLibCommonTargetProperties.cmake +++ b/CMLibCommonTargetProperties.cmake @@ -58,10 +58,10 @@ function(common_target_properties target) check_cxx_compiler_flag(-flto CXX_HAS_LTO_FLAG) check_cxx_compiler_flag(-fno-fat-lto-objects CXX_HAS_NO_FAT_LTO_FLAG) if(CXX_HAS_LTO_FLAG) - target_compile_options(${target} PUBLIC "-flto") + target_compile_options(${target} PUBLIC "$<$:-flto>") set_target_properties(${target} PROPERTIES LINK_FLAGS_RELEASE "-flto") if(CXX_HAS_NO_FAT_LTO_FLAG) - target_compile_options(${target} PUBLIC "-fno-fat-lto-objects") + target_compile_options(${target} PUBLIC "$<$:-fno-fat-lto-objects>") set_target_properties(${target} PROPERTIES LINK_FLAGS_RELEASE "-fno-fat-lto-objects") endif() endif()