diff options
author | Brad King <brad.king@kitware.com> | 2018-03-12 15:37:11 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2018-03-12 15:45:01 (GMT) |
commit | 2deb9b7f3495a9083b8d5341f867fed615da1470 (patch) | |
tree | 2dbffba599be936e428fba19c83f99a78c765037 /Tests/IncludeDirectories | |
parent | c5541cf0da1093635fea7da5a40e64e481b5477e (diff) | |
download | CMake-2deb9b7f3495a9083b8d5341f867fed615da1470.zip CMake-2deb9b7f3495a9083b8d5341f867fed615da1470.tar.gz CMake-2deb9b7f3495a9083b8d5341f867fed615da1470.tar.bz2 |
Genex: Fix COMPILE_LANGUAGE in SYSTEM include directories
When evaluating `INTERFACE_SYSTEM_INCLUDE_DIRECTORIES`, or evaluating
`INTERFACE_INCLUDE_DIRECTORIES` on an imported target, thread the
compile language through to the generator expression evaluator so
that it can support `$<COMPILE_LANGUAGE:...>`.
Fixes: #17811
Diffstat (limited to 'Tests/IncludeDirectories')
-rw-r--r-- | Tests/IncludeDirectories/SystemIncludeDirectories/CMakeLists.txt | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Tests/IncludeDirectories/SystemIncludeDirectories/CMakeLists.txt b/Tests/IncludeDirectories/SystemIncludeDirectories/CMakeLists.txt index 5078f30..c1059a9 100644 --- a/Tests/IncludeDirectories/SystemIncludeDirectories/CMakeLists.txt +++ b/Tests/IncludeDirectories/SystemIncludeDirectories/CMakeLists.txt @@ -52,6 +52,13 @@ 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} |