diff options
author | Tor Egge <Tor.Egge@online.no> | 2022-10-15 22:54:49 +0200 |
---|---|---|
committer | Tor Egge <Tor.Egge@online.no> | 2022-10-15 22:56:18 +0200 |
commit | 390c59438cb13e614836a94c074a0f96d9a747d4 (patch) | |
tree | d011e43e0d89609192b9d194857ffa2201130393 /functions.cmake | |
parent | 0230c92a6b53c267c6d9da5507bbffdc0717c8a1 (diff) |
Use target_link_options directly.
Diffstat (limited to 'functions.cmake')
-rw-r--r-- | functions.cmake | 16 |
1 files changed, 1 insertions, 15 deletions
diff --git a/functions.cmake b/functions.cmake index fd492a55c5b..7fa0b0db954 100644 --- a/functions.cmake +++ b/functions.cmake @@ -221,7 +221,7 @@ function(vespa_add_library TARGET) endif() if(NOT ARG_OBJECT AND NOT ARG_STATIC AND NOT ARG_INTERFACE AND NOT ARG_ALLOW_UNRESOLVED_SYMBOLS AND DEFINED VESPA_DISALLOW_UNRESOLVED_SYMBOLS_IN_SHARED_LIBRARIES) - __add_private_target_link_option(${TARGET} ${VESPA_DISALLOW_UNRESOLVED_SYMBOLS_IN_SHARED_LIBRARIES}) + target_link_options(${TARGET} PRIVATE ${VESPA_DISALLOW_UNRESOLVED_SYMBOLS_IN_SHARED_LIBRARIES}) endif() __add_target_to_module(${TARGET}) @@ -779,17 +779,3 @@ function(vespa_suppress_warnings_for_protobuf_sources) set_source_files_properties(${ARG_SOURCES} PROPERTIES COMPILE_FLAGS "-Wno-array-bounds -Wno-suggest-override -Wno-inline ${VESPA_DISABLE_UNUSED_WARNING}") endif() endfunction() - -function(__add_private_target_link_option TARGET TARGET_LINK_OPTION) - if(COMMAND target_link_options) - target_link_options(${TARGET} PRIVATE ${TARGET_LINK_OPTION}) - else() - get_target_property(TARGET_LINK_FLAGS ${TARGET} LINK_FLAGS) - if (NOT DEFINED TARGET_LINK_FLAGS OR ${TARGET_LINK_FLAGS} STREQUAL "" OR ${TARGET_LINK_FLAGS} STREQUAL "TARGET_LINK_FLAGS-NOTFOUND") - set(TARGET_LINK_FLAGS ${TARGET_LINK_OPTION}) - else() - set(TARGET_LINK_FLAGS "${TARGET_LINK_FLAGS} ${TARGET_LINK_OPTION}") - endif() - set_target_properties(${TARGET} PROPERTIES LINK_FLAGS "${TARGET_LINK_FLAGS}") - endif() -endfunction() |