mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-03 12:49:50 -05:00
d7e65b6178
These tests mess with the availability of C++ module support. Hide generation of the utility targets from any compiler detection.
17 lines
584 B
CMake
17 lines
584 B
CMake
# Enable scanning by default for targets that explicitly use C++ 20.
|
|
cmake_policy(SET CMP0155 NEW)
|
|
|
|
# Block making C++ `import std` targets.
|
|
add_library(__CMAKE::CXX23 IMPORTED INTERFACE)
|
|
|
|
# Force CMAKE_CXX_STANDARD_DEFAULT to be C++ 20.
|
|
set(ENV{CXXFLAGS} "$ENV{CXXFLAGS} ${CMAKE_CXX20_STANDARD_COMPILE_OPTION}")
|
|
enable_language(CXX)
|
|
|
|
# Hide any real scanning rule that may be available.
|
|
unset(CMAKE_CXX_SCANDEP_SOURCE)
|
|
|
|
# Create a target that does not explicitly use C++ 20 to verify it works
|
|
# without any scanning rule available.
|
|
add_executable(cmp0155-new sources/module-use.cxx)
|