Другой способ установки флагов
This commit is contained in:
parent
954b27fa27
commit
ef788f6cc5
@ -58,10 +58,10 @@ function(common_target_properties target)
|
|||||||
check_cxx_compiler_flag(-flto CXX_HAS_LTO_FLAG)
|
check_cxx_compiler_flag(-flto CXX_HAS_LTO_FLAG)
|
||||||
check_cxx_compiler_flag(-fno-fat-lto-objects CXX_HAS_NO_FAT_LTO_FLAG)
|
check_cxx_compiler_flag(-fno-fat-lto-objects CXX_HAS_NO_FAT_LTO_FLAG)
|
||||||
if(CXX_HAS_LTO_FLAG)
|
if(CXX_HAS_LTO_FLAG)
|
||||||
target_compile_options(${target} PUBLIC "-flto")
|
target_compile_options(${target} PUBLIC "$<$<CONFIG:RELEASE>:-flto>")
|
||||||
set_target_properties(${target} PROPERTIES LINK_FLAGS_RELEASE "-flto")
|
set_target_properties(${target} PROPERTIES LINK_FLAGS_RELEASE "-flto")
|
||||||
if(CXX_HAS_NO_FAT_LTO_FLAG)
|
if(CXX_HAS_NO_FAT_LTO_FLAG)
|
||||||
target_compile_options(${target} PUBLIC "-fno-fat-lto-objects")
|
target_compile_options(${target} PUBLIC "$<$<CONFIG:RELEASE>:-fno-fat-lto-objects>")
|
||||||
set_target_properties(${target} PROPERTIES LINK_FLAGS_RELEASE "-fno-fat-lto-objects")
|
set_target_properties(${target} PROPERTIES LINK_FLAGS_RELEASE "-fno-fat-lto-objects")
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
Loading…
Reference in New Issue
Block a user