summaryrefslogtreecommitdiffstats
path: root/Tests/IncludeDirectories/SystemIncludeDirectories
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2018-03-12 15:43:35 (GMT)
committerBrad King <brad.king@kitware.com>2018-03-12 17:30:14 (GMT)
commit1b5e52fd651ab17b3f9efb8f3e2e069550bf7a66 (patch)
tree2d02b554d043337f57a2f34976ce7403b947c877 /Tests/IncludeDirectories/SystemIncludeDirectories
parent2deb9b7f3495a9083b8d5341f867fed615da1470 (diff)
downloadCMake-1b5e52fd651ab17b3f9efb8f3e2e069550bf7a66.zip
CMake-1b5e52fd651ab17b3f9efb8f3e2e069550bf7a66.tar.gz
CMake-1b5e52fd651ab17b3f9efb8f3e2e069550bf7a66.tar.bz2
Genex: Fix COMPILE_LANGUAGE propagation through try_compile
When evaluating include directories during export to a `try_compile` test project, thread the compile language through to the generator expression evaluator so it can support `$<COMPILE_LANGUAGE:...>`. Issue: #17811
Diffstat (limited to 'Tests/IncludeDirectories/SystemIncludeDirectories')
-rw-r--r--Tests/IncludeDirectories/SystemIncludeDirectories/CMakeLists.txt11
1 files changed, 3 insertions, 8 deletions
diff --git a/Tests/IncludeDirectories/SystemIncludeDirectories/CMakeLists.txt b/Tests/IncludeDirectories/SystemIncludeDirectories/CMakeLists.txt
index c1059a9..20bd601 100644
--- a/Tests/IncludeDirectories/SystemIncludeDirectories/CMakeLists.txt
+++ b/Tests/IncludeDirectories/SystemIncludeDirectories/CMakeLists.txt
@@ -32,7 +32,9 @@ target_link_libraries(consumer upstream config_specific)
target_compile_options(consumer PRIVATE -Werror=unused-variable)
add_library(iface IMPORTED INTERFACE)
-set_property(TARGET iface PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}/systemlib_header_only")
+set_property(TARGET iface PROPERTY INTERFACE_INCLUDE_DIRECTORIES
+ "$<$<COMPILE_LANGUAGE:CXX>:${CMAKE_CURRENT_SOURCE_DIR}/systemlib_header_only>"
+ )
add_library(imported_consumer imported_consumer.cpp)
target_link_libraries(imported_consumer iface)
@@ -52,13 +54,6 @@ add_library(otherlib upstream.cpp)
target_link_libraries(otherlib PUBLIC somelib)
target_compile_options(somelib PRIVATE -Werror=unused-variable)
-add_library(iface_lang IMPORTED INTERFACE)
-set_property(TARGET iface_lang PROPERTY INTERFACE_INCLUDE_DIRECTORIES
- "$<$<COMPILE_LANGUAGE:CXX>:${CMAKE_CURRENT_SOURCE_DIR}/systemlib_header_only>"
- )
-add_library(imported_consumer_lang imported_consumer.cpp)
-target_link_libraries(imported_consumer_lang iface_lang)
-
macro(do_try_compile error_option)
set(TC_ARGS
IFACE_TRY_COMPILE_${error_option}