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/RunCMake/target_link_directories/genex_LINK_LANGUAGE.cmake | |
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/RunCMake/target_link_directories/genex_LINK_LANGUAGE.cmake')
-rw-r--r-- | Tests/RunCMake/target_link_directories/genex_LINK_LANGUAGE.cmake | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/Tests/RunCMake/target_link_directories/genex_LINK_LANGUAGE.cmake b/Tests/RunCMake/target_link_directories/genex_LINK_LANGUAGE.cmake new file mode 100644 index 0000000..1f266b1 --- /dev/null +++ b/Tests/RunCMake/target_link_directories/genex_LINK_LANGUAGE.cmake @@ -0,0 +1,23 @@ + +enable_language(C) +enable_language(CXX) + +set(CMAKE_VERBOSE_MAKEFILE TRUE) +set(CMAKE_C_USE_RESPONSE_FILE_FOR_LIBRARIES FALSE) +set(CMAKE_CXX_USE_RESPONSE_FILE_FOR_LIBRARIES FALSE) + +add_library(LinkDirs_interface INTERFACE) +target_link_directories (LinkDirs_interface INTERFACE "$<$<LINK_LANGUAGE:C>:/DIR_C_INTERFACE>" + "$<$<LINK_LANGUAGE:CXX>:/DIR_CXX_INTERFACE>") + +add_executable(LinkDirs_exe_interface exe.c) +target_link_libraries (LinkDirs_exe_interface PRIVATE LinkDirs_interface) + +add_executable(LinkDirs_exe_c exe.c) +target_link_directories (LinkDirs_exe_c PRIVATE "$<$<LINK_LANGUAGE:C>:/DIR_C_EXE>" + "$<$<LINK_LANGUAGE:CXX>:/DIR_CXX_EXE>") + +add_executable(LinkDirs_exe_cxx exe.c) +target_link_directories (LinkDirs_exe_cxx PRIVATE "$<$<LINK_LANGUAGE:C>:/DIR_C_EXE>" + "$<$<LINK_LANGUAGE:CXX>:/DIR_CXX_EXE>") +set_property (TARGET LinkDirs_exe_cxx PROPERTY LINKER_LANGUAGE CXX) |