diff options
author | Ben Boeckel <ben.boeckel@kitware.com> | 2023-07-02 20:11:54 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2023-07-13 12:40:22 (GMT) |
commit | 71f1483aac64ccb3341376558f943021b1195e80 (patch) | |
tree | 7033474907481b9c12b520a3aaf835fad4193363 /Tests/RunCMake/CXXModules | |
parent | e39b6ebc19d276f739500192a15fa809639857c2 (diff) | |
download | CMake-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.txt | 2 | ||||
-rw-r--r-- | Tests/RunCMake/CXXModules/examples/deep-chain/CMakeLists.txt | 8 |
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 |