mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-05 21:31:08 -06:00
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.
This commit is contained in:
@@ -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
|
CMake's C\+\+ module support is experimental. It is meant only for
|
||||||
experimentation and feedback to CMake developers.
|
experimentation and feedback to CMake developers.
|
||||||
This warning is for project developers. Use -Wno-dev to suppress it.
|
This warning is for project developers. Use -Wno-dev to suppress it.
|
||||||
|
|||||||
@@ -3,6 +3,14 @@ project(cxx_modules_deep_chain CXX)
|
|||||||
|
|
||||||
include("${CMAKE_SOURCE_DIR}/../cxx-modules-rules.cmake")
|
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)
|
add_library(a STATIC)
|
||||||
target_sources(a
|
target_sources(a
|
||||||
PUBLIC
|
PUBLIC
|
||||||
|
|||||||
Reference in New Issue
Block a user