mirror of
https://github.com/Kitware/CMake.git
synced 2026-04-24 15:18:26 -05:00
c1f5a44b28
This family enable to manage link flags Three new properties: * directory property: LINK_OPTIONS * target properties: LINK_OPTIONS and INTERFACE_LINK_OPTIONS Two new commands * add_link_options(): to populate directory property * target_link_options(): to populate target properties Fixes: #16543
21 lines
553 B
CMake
21 lines
553 B
CMake
cmake_minimum_required(VERSION 3.11)
|
|
|
|
project(add_link_options LANGUAGES C)
|
|
|
|
|
|
add_link_options(-LINK_FLAG)
|
|
|
|
add_executable(add_link_options EXCLUDE_FROM_ALL LinkOptionsExe.c)
|
|
|
|
get_target_property(result add_link_options LINK_OPTIONS)
|
|
if (NOT result MATCHES "-LINK_FLAG")
|
|
message(SEND_ERROR "add_link_options not populated the LINK_OPTIONS target property")
|
|
endif()
|
|
|
|
|
|
add_library(imp UNKNOWN IMPORTED)
|
|
get_target_property(result imp LINK_OPTIONS)
|
|
if (result)
|
|
message(FATAL_ERROR "add_link_options populated the LINK_OPTIONS target property")
|
|
endif()
|