summaryrefslogtreecommitdiffstats
path: root/Tests/CompileDefinitions/target_prop
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2013-05-16 13:52:25 (GMT)
committerBrad King <brad.king@kitware.com>2013-05-24 13:06:53 (GMT)
commit32410140a7c592090249db772fd5f18c7808a3aa (patch)
tree055e13759b3d6a1a7d67311c3f0fcb609c5adcdb /Tests/CompileDefinitions/target_prop
parenta7ba4520c7b15dc9f56d2c4718748b79b12c0c89 (diff)
downloadCMake-32410140a7c592090249db772fd5f18c7808a3aa.zip
CMake-32410140a7c592090249db772fd5f18c7808a3aa.tar.gz
CMake-32410140a7c592090249db772fd5f18c7808a3aa.tar.bz2
Add $<LINK_LANGUAGE> generator expression
They can't be used when evaluating link libraries, but they can be used for include directories and compile definitions. Later they can be used for compile options.
Diffstat (limited to 'Tests/CompileDefinitions/target_prop')
-rw-r--r--Tests/CompileDefinitions/target_prop/CMakeLists.txt20
1 files changed, 20 insertions, 0 deletions
diff --git a/Tests/CompileDefinitions/target_prop/CMakeLists.txt b/Tests/CompileDefinitions/target_prop/CMakeLists.txt
index 34be917..66a3aa6 100644
--- a/Tests/CompileDefinitions/target_prop/CMakeLists.txt
+++ b/Tests/CompileDefinitions/target_prop/CMakeLists.txt
@@ -19,9 +19,29 @@ set_property(TARGET target_prop_executable APPEND PROPERTY COMPILE_DEFINITIONS
LETTER_LIST3=\"$<JOIN:A;B;C;D,,->\"
LETTER_LIST4=\"$<JOIN:A;B;C;D,-,->\"
LETTER_LIST5=\"$<JOIN:A;B;C;D,-,>\"
+ "$<$<LINK_LANGUAGE:CXX>:LINK_CXX_DEFINE>"
+ "$<$<LINK_LANGUAGE:C>:LINK_C_DEFINE>"
+ "LINK_LANGUAGE_IS_$<LINK_LANGUAGE>"
)
set_property(TARGET target_prop_executable APPEND PROPERTY COMPILE_DEFINITIONS
BUILD_IS_DEBUG=$<CONFIG:Debug>
BUILD_IS_NOT_DEBUG=$<NOT:$<CONFIG:Debug>>
)
+
+add_executable(target_prop_c_executable ../compiletest.c)
+
+set_property(TARGET target_prop_c_executable APPEND PROPERTY COMPILE_DEFINITIONS
+ "$<$<LINK_LANGUAGE:CXX>:LINK_CXX_DEFINE>"
+ "$<$<LINK_LANGUAGE:C>:LINK_C_DEFINE>"
+ "LINK_LANGUAGE_IS_$<LINK_LANGUAGE>"
+ )
+
+# Resulting link language will be CXX
+add_executable(target_prop_mixed_executable ../compiletest_mixed_c.c ../compiletest_mixed_cxx.cpp)
+
+set_property(TARGET target_prop_mixed_executable APPEND PROPERTY COMPILE_DEFINITIONS
+ "$<$<LINK_LANGUAGE:CXX>:LINK_CXX_DEFINE>"
+ "$<$<LINK_LANGUAGE:C>:LINK_C_DEFINE>"
+ "LINK_LANGUAGE_IS_$<LINK_LANGUAGE>"
+ )