3.25.0: Regression in C++20 useable without modules
As soon as I enable C++20 CMake changes it's behaviour to enable C++20 modules.
I want to use C++20 features without any C++ modules. Even if the compiler supports them, they cannot be used by the majority of projects, as long this is experimental and not all compilers have support.
With CMake 3.25.0 on Windows I get the following Configure warning as soon as I enable C++20 support:
-- Configuring done
CMake Warning (dev):
C++20 modules support via CMAKE_EXPERIMENTAL_CXX_MODULE_DYNDEP is
experimental. It is meant only for compiler developers to try.
This warning is for project developers. Use -Wno-dev to suppress it.
-- Generating done
It does not seem to matter how I enable C++20 support.
Setting CMAKE_EXPERIMENTAL_CXX_MODULE_DYNDEP
to 0 does not remove the warning or the modules behaviour.
Regarding the behaviour. The build steps for scanning and generating dyndeps are added:
[1/4 3.3/sec] Scanning R:\CMakeDemo\main.cpp for CXX dependencies
[2/4 6.1/sec] Generating CXX dyndep file CMakeFiles\CMakeDemo.dir\CXX.dd
[3/4 2.7/sec] Building CXX object CMakeFiles\CMakeDemo.dir\main.cpp.obj
[4/4 3.0/sec] Linking CXX executable CMakeDemo.exe
With C++17 the warning goes away and the build steps are reduced:
[1/2 1.5/sec] Building CXX object CMakeFiles\CMakeDemo.dir\main.cpp.obj
[2/2 2.6/sec] Linking CXX executable CMakeDemo.exe
How can we use C++20 language support and disable all the extra behaviour meant for experimental C++20 modules?