diff options
Diffstat (limited to 'Tests/RunCMake')
4 files changed, 15 insertions, 0 deletions
diff --git a/Tests/RunCMake/target_link_options/LINK_OPTIONS-interface-static-check.cmake b/Tests/RunCMake/target_link_options/LINK_OPTIONS-interface-static-check.cmake new file mode 100644 index 0000000..6c5ffdb --- /dev/null +++ b/Tests/RunCMake/target_link_options/LINK_OPTIONS-interface-static-check.cmake @@ -0,0 +1,4 @@ + +if (NOT actual_stdout MATCHES "BADFLAG_INTERFACE") + set (RunCMake_TEST_FAILED "Not found expected 'BADFLAG_INTERFACE'.") +endif() diff --git a/Tests/RunCMake/target_link_options/LINK_OPTIONS-interface-static-result.txt b/Tests/RunCMake/target_link_options/LINK_OPTIONS-interface-static-result.txt new file mode 100644 index 0000000..8d98f9d --- /dev/null +++ b/Tests/RunCMake/target_link_options/LINK_OPTIONS-interface-static-result.txt @@ -0,0 +1 @@ +.* diff --git a/Tests/RunCMake/target_link_options/LINK_OPTIONS.cmake b/Tests/RunCMake/target_link_options/LINK_OPTIONS.cmake index 84cf129..bb04841 100644 --- a/Tests/RunCMake/target_link_options/LINK_OPTIONS.cmake +++ b/Tests/RunCMake/target_link_options/LINK_OPTIONS.cmake @@ -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}> diff --git a/Tests/RunCMake/target_link_options/RunCMakeTest.cmake b/Tests/RunCMake/target_link_options/RunCMakeTest.cmake index 39f580f..1eaa5d2 100644 --- a/Tests/RunCMake/target_link_options/RunCMakeTest.cmake +++ b/Tests/RunCMake/target_link_options/RunCMakeTest.cmake @@ -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) |