Добавление флагов в виде строк

This commit is contained in:
Andrei Astafev 2020-06-26 04:09:40 +03:00
parent 2e18f5981b
commit 186d67c4bb
2 changed files with 4 additions and 4 deletions

View File

@ -7,7 +7,7 @@ function(add_code_coverage target)
if(CMLIB_ENABLE_CODE_COVERAGE)
if(CMAKE_CXX_COMPILER_IS_GCC)
target_compile_options(${target} PUBLIC "--coverage")
set_property(TARGET ${target} APPEND PROPERTY LINK_FLAGS "--coverage")
set_property(TARGET ${target} APPEND_STRING PROPERTY LINK_FLAGS " --coverage")
if(LCOV_EXE)
add_custom_target(

View File

@ -51,7 +51,7 @@ function(common_target_properties target)
endif()
endif()
if(CMAKE_CXX_COMPILER_IS_GCC AND NOT APPLE)
set_property(TARGET ${target} APPEND PROPERTY LINK_FLAGS "-Wl,--no-as-needed")
set_property(TARGET ${target} APPEND_STRING PROPERTY LINK_FLAGS " -Wl,--no-as-needed")
endif()
endif()
@ -61,10 +61,10 @@ function(common_target_properties target)
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")
set_property(TARGET ${target} APPEND PROPERTY LINK_FLAGS "-flto")
set_property(TARGET ${target} APPEND_STRING PROPERTY LINK_FLAGS " -flto")
if(CXX_HAS_NO_FAT_LTO_FLAG)
target_compile_options(${target} PUBLIC "-fno-fat-lto-objects")
set_property(TARGET ${target} APPEND PROPERTY LINK_FLAGS "-fno-fat-lto-objects")
set_property(TARGET ${target} APPEND_STRING PROPERTY LINK_FLAGS " -fno-fat-lto-objects")
endif()
endif()
endif()