diff options
author | Marc Chevrier <marc.chevrier@gmail.com> | 2019-12-13 21:55:00 (GMT) |
---|---|---|
committer | Marc Chevrier <marc.chevrier@gmail.com> | 2020-02-26 15:38:42 (GMT) |
commit | 461efa7b51f5d63ab5e366af3a615a469ac0e65f (patch) | |
tree | d703f0e23d718fe225b70fffd09e028576c4d4e9 /Tests/BuildDepends | |
parent | 54d1268ed466c68845e01d28fc17f162f384ac39 (diff) | |
download | CMake-461efa7b51f5d63ab5e366af3a615a469ac0e65f.zip CMake-461efa7b51f5d63ab5e366af3a615a469ac0e65f.tar.gz CMake-461efa7b51f5d63ab5e366af3a615a469ac0e65f.tar.bz2 |
Genex: Add $<LINK_LANGUAGE:...> and $<LINK_LANG_AND_ID:...>
This MR may help to solve issues #19757 and #18008
Fixes: #19965
Diffstat (limited to 'Tests/BuildDepends')
-rw-r--r-- | Tests/BuildDepends/CMakeLists.txt | 22 | ||||
-rw-r--r-- | Tests/BuildDepends/Project/CMakeLists.txt | 8 |
2 files changed, 30 insertions, 0 deletions
diff --git a/Tests/BuildDepends/CMakeLists.txt b/Tests/BuildDepends/CMakeLists.txt index c1ad17c..5ddae83 100644 --- a/Tests/BuildDepends/CMakeLists.txt +++ b/Tests/BuildDepends/CMakeLists.txt @@ -368,6 +368,28 @@ is not newer than dependency ${TEST_LINK_DEPENDS} ") endif() + + set(linkdep3 ${BuildDepends_BINARY_DIR}/Project/linkdep3${CMAKE_EXECUTABLE_SUFFIX}) + if(${linkdep3} IS_NEWER_THAN ${TEST_LINK_DEPENDS}) + message("$<LINK_LANGUAGE> in LINK_DEPENDS worked") + else() + message(SEND_ERROR "$<LINK_LANGUAGE> in LINK_DEPENDS failed. Executable + ${linkdep3} +is not newer than dependency + ${TEST_LINK_DEPENDS} +") + endif() + + set(linkdep4 ${BuildDepends_BINARY_DIR}/Project/linkdep4${CMAKE_EXECUTABLE_SUFFIX}) + if(${linkdep4} IS_NEWER_THAN ${TEST_LINK_DEPENDS}) + message("$<LINK_LANGUAGE> in INTERFACE_LINK_DEPENDS worked") + else() + message(SEND_ERROR "$<LINK_LANGUAGE> in INTERFACE_LINK_DEPENDS failed. Executable + ${linkdep4} +is not newer than dependency + ${TEST_LINK_DEPENDS} +") + endif() endif() if(EXISTS "${link_depends_no_shared_check_txt}") diff --git a/Tests/BuildDepends/Project/CMakeLists.txt b/Tests/BuildDepends/Project/CMakeLists.txt index 8338800..83583c9 100644 --- a/Tests/BuildDepends/Project/CMakeLists.txt +++ b/Tests/BuildDepends/Project/CMakeLists.txt @@ -118,6 +118,14 @@ if(TEST_LINK_DEPENDS) set_property(TARGET foo_interface PROPERTY INTERFACE_LINK_DEPENDS $<1:${TEST_LINK_DEPENDS}>) add_executable(linkdep2 linkdep.cxx) target_link_libraries(linkdep2 PRIVATE foo_interface) + + add_executable(linkdep3 linkdep.cxx) + set_property(TARGET linkdep3 PROPERTY LINK_DEPENDS $<$<LINK_LANGUAGE:CXX>:${TEST_LINK_DEPENDS}>) + + add_library(foo_interface2 INTERFACE) + set_property(TARGET foo_interface2 PROPERTY INTERFACE_LINK_DEPENDS $<$<LINK_LANGUAGE:CXX>:${TEST_LINK_DEPENDS}>) + add_executable(linkdep4 linkdep.cxx) + target_link_libraries(linkdep4 PRIVATE foo_interface2) endif() add_library(link_depends_no_shared_lib SHARED link_depends_no_shared_lib.c |