summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/CXXModules
diff options
context:
space:
mode:
authorBen Boeckel <ben.boeckel@kitware.com>2023-07-02 20:11:54 (GMT)
committerBrad King <brad.king@kitware.com>2023-07-13 12:40:22 (GMT)
commit71f1483aac64ccb3341376558f943021b1195e80 (patch)
tree7033474907481b9c12b520a3aaf835fad4193363 /Tests/RunCMake/CXXModules
parente39b6ebc19d276f739500192a15fa809639857c2 (diff)
downloadCMake-71f1483aac64ccb3341376558f943021b1195e80.zip
CMake-71f1483aac64ccb3341376558f943021b1195e80.tar.gz
CMake-71f1483aac64ccb3341376558f943021b1195e80.tar.bz2
Tests/RunCMake/CXXModules: require transitive usages
Clang 17 is in a transition where it warns about transitive usages. Turn it into an error if the flag is available to make sure we're testing the feature properly.
Diffstat (limited to 'Tests/RunCMake/CXXModules')
-rw-r--r--Tests/RunCMake/CXXModules/examples/deep-chain-stderr.txt2
-rw-r--r--Tests/RunCMake/CXXModules/examples/deep-chain/CMakeLists.txt8
2 files changed, 9 insertions, 1 deletions
diff --git a/Tests/RunCMake/CXXModules/examples/deep-chain-stderr.txt b/Tests/RunCMake/CXXModules/examples/deep-chain-stderr.txt
index 78bdf2b..659414d 100644
--- a/Tests/RunCMake/CXXModules/examples/deep-chain-stderr.txt
+++ b/Tests/RunCMake/CXXModules/examples/deep-chain-stderr.txt
@@ -1,4 +1,4 @@
-CMake Warning \(dev\) at CMakeLists.txt:7 \(target_sources\):
+CMake Warning \(dev\) at CMakeLists.txt:15 \(target_sources\):
CMake's C\+\+ module support is experimental. It is meant only for
experimentation and feedback to CMake developers.
This warning is for project developers. Use -Wno-dev to suppress it.
diff --git a/Tests/RunCMake/CXXModules/examples/deep-chain/CMakeLists.txt b/Tests/RunCMake/CXXModules/examples/deep-chain/CMakeLists.txt
index 515b240..78a1d0b 100644
--- a/Tests/RunCMake/CXXModules/examples/deep-chain/CMakeLists.txt
+++ b/Tests/RunCMake/CXXModules/examples/deep-chain/CMakeLists.txt
@@ -3,6 +3,14 @@ project(cxx_modules_deep_chain CXX)
include("${CMAKE_SOURCE_DIR}/../cxx-modules-rules.cmake")
+if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
+ include(CheckCompilerFlag)
+ check_compiler_flag(CXX "-Wread-modules-implicitly" have_implicit_module_warning)
+ if (have_implicit_module_warning)
+ add_compile_options(-Werror=read-modules-implicitly)
+ endif ()
+endif ()
+
add_library(a STATIC)
target_sources(a
PUBLIC