mirror of
https://github.com/reactos/CMake.git
synced 2024-12-11 21:34:32 +00:00
LINK_OPTIONS property: add test for static library.
Check that property INTERFACE_LINK_OPTIONS is correctly propagated from static libraries. Issue: #18251
This commit is contained in:
parent
349f8bfb25
commit
174721ecc0
@ -15,5 +15,12 @@ if (NOT result MATCHES "-PRIVATE_FLAG")
|
||||
endif()
|
||||
get_target_property(result target_link_options_2 INTERFACE_LINK_OPTIONS)
|
||||
if (NOT result MATCHES "-INTERFACE_FLAG")
|
||||
message(SEND_ERROR "target_link_options not populated the INTERFACE_LINK_OPTIONS target property")
|
||||
message(SEND_ERROR "target_link_options not populated the INTERFACE_LINK_OPTIONS target property of shared library")
|
||||
endif()
|
||||
|
||||
add_library(target_link_options_3 STATIC EXCLUDE_FROM_ALL LinkOptionsLib.c)
|
||||
target_link_options(target_link_options_3 INTERFACE -INTERFACE_FLAG)
|
||||
get_target_property(result target_link_options_3 INTERFACE_LINK_OPTIONS)
|
||||
if (NOT result MATCHES "-INTERFACE_FLAG")
|
||||
message(SEND_ERROR "target_link_options not populated the INTERFACE_LINK_OPTIONS target property of static library")
|
||||
endif()
|
||||
|
@ -0,0 +1,4 @@
|
||||
|
||||
if (NOT actual_stdout MATCHES "BADFLAG_INTERFACE")
|
||||
set (RunCMake_TEST_FAILED "Not found expected 'BADFLAG_INTERFACE'.")
|
||||
endif()
|
@ -0,0 +1 @@
|
||||
.*
|
@ -22,6 +22,15 @@ add_executable(LinkOptions_consumer LinkOptionsExe.c)
|
||||
target_link_libraries(LinkOptions_consumer PRIVATE LinkOptions_producer)
|
||||
|
||||
|
||||
# static library with INTERFACE_LINK_OPTIONS
|
||||
add_library(LinkOptions_producer_static STATIC LinkOptionsLib.c)
|
||||
target_link_options(LinkOptions_producer_static
|
||||
INTERFACE ${pre}BADFLAG_INTERFACE${obj})
|
||||
|
||||
add_executable(LinkOptions_consumer_static LinkOptionsExe.c)
|
||||
target_link_libraries(LinkOptions_consumer_static PRIVATE LinkOptions_producer_static)
|
||||
|
||||
|
||||
# static library with generator expression
|
||||
add_library(LinkOptions_static STATIC LinkOptionsLib.c)
|
||||
target_link_options(LinkOptions_static PRIVATE $<$<CONFIG:Release>:${pre}BADFLAG_RELEASE${obj}>
|
||||
|
@ -21,6 +21,7 @@ if (NOT CMAKE_C_COMPILER_ID STREQUAL "Intel")
|
||||
|
||||
run_cmake_target(LINK_OPTIONS basic LinkOptions)
|
||||
run_cmake_target(LINK_OPTIONS interface LinkOptions_consumer)
|
||||
run_cmake_target(LINK_OPTIONS interface-static LinkOptions_consumer_static)
|
||||
run_cmake_target(LINK_OPTIONS static LinkOptions_static --config Release)
|
||||
run_cmake_target(LINK_OPTIONS shared LinkOptions_shared --config Release)
|
||||
run_cmake_target(LINK_OPTIONS mod LinkOptions_mod --config Release)
|
||||
|
Loading…
Reference in New Issue
Block a user