diff options
author | Marc Chevrier <marc.chevrier@gmail.com> | 2022-03-22 16:07:16 (GMT) |
---|---|---|
committer | Marc Chevrier <marc.chevrier@gmail.com> | 2022-03-25 11:29:28 (GMT) |
commit | 1777883f8bcd0fe8cbdf88429d46530a05584a6c (patch) | |
tree | 04adb9a611b1fb38edff3522aef89e1a1041e3d1 /Tests/RunCMake/target_link_libraries-LINK_GROUP | |
parent | 232884345078a89d7f29fea2900be34c178bc10c (diff) | |
download | CMake-1777883f8bcd0fe8cbdf88429d46530a05584a6c.zip CMake-1777883f8bcd0fe8cbdf88429d46530a05584a6c.tar.gz CMake-1777883f8bcd0fe8cbdf88429d46530a05584a6c.tar.bz2 |
genex-LINK_(LIBRARY|GROUP) features: update variables behavior
Variable CMAKE_LINK_(LIBRARY|GROUP)_USING_<FEATURE>_SUPPORTED is evaluated
only if CMAKE_<LANG>_LINK_(LIBRARY|GROUP)_USING_<FEATURE>_SUPPORTED is not defined.
This new behavior enable to activate a feature globally on a platform and to disable
it for some compilers and languages.
Diffstat (limited to 'Tests/RunCMake/target_link_libraries-LINK_GROUP')
4 files changed, 13 insertions, 0 deletions
diff --git a/Tests/RunCMake/target_link_libraries-LINK_GROUP/LINK_GROUP-multiple-definitions-result.txt b/Tests/RunCMake/target_link_libraries-LINK_GROUP/LINK_GROUP-multiple-definitions-result.txt new file mode 100644 index 0000000..8d98f9d --- /dev/null +++ b/Tests/RunCMake/target_link_libraries-LINK_GROUP/LINK_GROUP-multiple-definitions-result.txt @@ -0,0 +1 @@ +.* diff --git a/Tests/RunCMake/target_link_libraries-LINK_GROUP/LINK_GROUP-mutiple-definitions-check.cmake b/Tests/RunCMake/target_link_libraries-LINK_GROUP/LINK_GROUP-mutiple-definitions-check.cmake new file mode 100644 index 0000000..3e53d26 --- /dev/null +++ b/Tests/RunCMake/target_link_libraries-LINK_GROUP/LINK_GROUP-mutiple-definitions-check.cmake @@ -0,0 +1,4 @@ + +if (NOT actual_stdout MATCHES "(/|-)-START_GROUP\"? +.*${LINK_SHARED_LIBRARY_PREFIX}base1${LINK_SHARED_LIBRARY_SUFFIX} +.*${LINK_SHARED_LIBRARY_PREFIX}base2${LINK_SHARED_LIBRARY_SUFFIX} +\"?(/|-)-END_GROUP") + set (RunCMake_TEST_FAILED "Not found expected '--START_GROUP <base1> <base2> --END_GROUP'.") +endif() diff --git a/Tests/RunCMake/target_link_libraries-LINK_GROUP/LINK_GROUP.cmake b/Tests/RunCMake/target_link_libraries-LINK_GROUP/LINK_GROUP.cmake index d08db16..31eb7e2 100644 --- a/Tests/RunCMake/target_link_libraries-LINK_GROUP/LINK_GROUP.cmake +++ b/Tests/RunCMake/target_link_libraries-LINK_GROUP/LINK_GROUP.cmake @@ -20,6 +20,9 @@ set(CMAKE_C_LINK_GROUP_USING_feat1_SUPPORTED TRUE) set(CMAKE_C_LINK_LIBRARY_USING_feat1 "--LIBFLAG<LIBRARY>") set(CMAKE_C_LINK_LIBRARY_USING_feat1_SUPPORTED TRUE) +set(CMAKE_C_LINK_GROUP_USING_feat2 "--START_GROUP" "--END_GROUP") +set(CMAKE_LINK_GROUP_USING_feat2 "--START_GROUP" "--END_GROUP") +set(CMAKE_LINK_GROUP_USING_feat2_SUPPORTED TRUE) add_library(LinkGroup_simple1 SHARED lib.c) target_link_libraries(LinkGroup_simple1 PRIVATE "$<LINK_GROUP:feat1,base1,base2>") @@ -31,6 +34,10 @@ add_library(LinkGroup_simple2 SHARED lib.c) target_link_libraries(LinkGroup_simple2 PRIVATE "$<LINK_GROUP:feat1,base2,base3>") +add_library(LinkGroup_multiple-definitions SHARED lib.c) +target_link_libraries(LinkGroup_multiple-definitions PRIVATE "$<LINK_GROUP:feat2,base1,base2>") + + add_library(base4 SHARED base.c) target_link_libraries(base4 INTERFACE "$<LINK_GROUP:feat1,base1,base2>") add_library(LinkGroup_multiple-groups SHARED lib.c) diff --git a/Tests/RunCMake/target_link_libraries-LINK_GROUP/RunCMakeTest.cmake b/Tests/RunCMake/target_link_libraries-LINK_GROUP/RunCMakeTest.cmake index 400905c..c1d74d0 100644 --- a/Tests/RunCMake/target_link_libraries-LINK_GROUP/RunCMakeTest.cmake +++ b/Tests/RunCMake/target_link_libraries-LINK_GROUP/RunCMakeTest.cmake @@ -42,6 +42,7 @@ if ((RunCMake_GENERATOR MATCHES "Makefiles|Ninja|Xcode" run_cmake_target(LINK_GROUP simple1 LinkGroup_simple1) run_cmake_target(LINK_GROUP simple2 LinkGroup_simple2) + run_cmake_target(LINK_GROUP multiple-definitions LinkGroup_multiple-definitions) run_cmake_target(LINK_GROUP multiple-groups LinkGroup_multiple-groups) run_cmake_target(LINK_GROUP group-and-single LinkGroup_group-and-single) run_cmake_target(LINK_GROUP with-LINK_LIBRARY LinkGroup_with-LINK_LIBRARY) |