Use target_link_options directly.
@@ -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()
