summaryrefslogtreecommitdiff
path: root/Tests
diff options
context:
space:
mode:
authorKyle Edwards <kyle.edwards@kitware.com>2022-07-27 13:29:09 -0400
committerKyle Edwards <kyle.edwards@kitware.com>2022-07-27 13:29:09 -0400
commit41f15193e5adfaaf9990b2d8d81bb0ec6c05572c (patch)
tree76edc6bb52a361a66ae085e11bd9a3baadd1ea24 /Tests
parent22c535299019eb835dd0d5793d3b40e59d0cc6ee (diff)
downloadcmake-41f15193e5adfaaf9990b2d8d81bb0ec6c05572c.tar.gz
VERIFY_INTERFACE_HEADER_SETS: Fall back to global languages
If a target doesn't have any source files, fall back to the global list of enabled languages to determine the language of the header file to verify. Fixes: #23774
Diffstat (limited to 'Tests')
-rw-r--r--Tests/RunCMake/VerifyHeaderSets/RunCMakeTest.cmake1
-rw-r--r--Tests/RunCMake/VerifyHeaderSets/VerifyHeaderSets.cmake4
2 files changed, 5 insertions, 0 deletions
diff --git a/Tests/RunCMake/VerifyHeaderSets/RunCMakeTest.cmake b/Tests/RunCMake/VerifyHeaderSets/RunCMakeTest.cmake
index f022a43c47..9f9a1e70bd 100644
--- a/Tests/RunCMake/VerifyHeaderSets/RunCMakeTest.cmake
+++ b/Tests/RunCMake/VerifyHeaderSets/RunCMakeTest.cmake
@@ -40,6 +40,7 @@ endif()
run_cmake_build(VerifyHeaderSets lang_test_c_verify_interface_header_sets)
run_cmake_build(VerifyHeaderSets lang_test_cxx_verify_interface_header_sets)
+run_cmake_build(VerifyHeaderSets interface_lang_test_cxx_verify_interface_header_sets)
run_cmake_build(VerifyHeaderSets list_verify_interface_header_sets)
set(RunCMake_TEST_OPTIONS -DCMAKE_VERIFY_INTERFACE_HEADER_SETS=ON)
diff --git a/Tests/RunCMake/VerifyHeaderSets/VerifyHeaderSets.cmake b/Tests/RunCMake/VerifyHeaderSets/VerifyHeaderSets.cmake
index 82ed935a62..70dc89b55c 100644
--- a/Tests/RunCMake/VerifyHeaderSets/VerifyHeaderSets.cmake
+++ b/Tests/RunCMake/VerifyHeaderSets/VerifyHeaderSets.cmake
@@ -59,6 +59,10 @@ add_library(lang_test_cxx STATIC lib.c lib.cxx)
target_compile_definitions(lang_test_cxx INTERFACE EXPECT_CXX)
target_sources(lang_test_cxx INTERFACE FILE_SET HEADERS FILES lang_test.h)
+add_library(interface_lang_test_cxx INTERFACE)
+target_compile_definitions(interface_lang_test_cxx INTERFACE EXPECT_CXX)
+target_sources(interface_lang_test_cxx INTERFACE FILE_SET HEADERS FILES lang_test.h)
+
set_property(SOURCE error.h PROPERTY LANGUAGE C)
add_library(list STATIC lib.c)