diff options
author | Ben Boeckel <ben.boeckel@kitware.com> | 2023-09-28 01:57:54 (GMT) |
---|---|---|
committer | Ben Boeckel <ben.boeckel@kitware.com> | 2023-10-02 14:17:31 (GMT) |
commit | 437280b1273cf80287639ef4d6a0a9266e23c2b1 (patch) | |
tree | 0ece1c82ca8fe517f48e87e3e2f23f839ccd36ef /Help/policy | |
parent | 3cddd116495a85ce86e1149c05ce9a2a701e0c8b (diff) | |
download | CMake-437280b1273cf80287639ef4d6a0a9266e23c2b1.zip CMake-437280b1273cf80287639ef4d6a0a9266e23c2b1.tar.gz CMake-437280b1273cf80287639ef4d6a0a9266e23c2b1.tar.bz2 |
cxxmodules: scan C++ sources for imports by default
Existing projects are not using C++ modules in their sources,
so introduce policy CMP0155 to enable scanning by default.
Diffstat (limited to 'Help/policy')
-rw-r--r-- | Help/policy/CMP0155.rst | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/Help/policy/CMP0155.rst b/Help/policy/CMP0155.rst new file mode 100644 index 0000000..2dafadf --- /dev/null +++ b/Help/policy/CMP0155.rst @@ -0,0 +1,26 @@ +CMP0155 +------- + +.. versionadded:: 3.28 + +C++ sources in targets with at least C++20 are scanned for imports. + +CMake 3.27 and below assume that C++ sources do not ``import`` modules. +CMake 3.28 and above prefer to assume that C++ sources in targets using C++20 +or higher might ``import`` modules, and must be scanned before compiling, +unless explicitly disabled. This policy provides compatibility for projects +that use C++20 or higher, without modules, that have not been updated to turn +off scanning, e.g., via the :variable:`CMAKE_CXX_SCAN_FOR_MODULES` variable. +See the :manual:`cmake-cxxmodules(7)` manual for more details on C++ module +support. + +The ``OLD`` behavior for this policy is to assume that C++ 20 and newer +sources do not import modules. The ``NEW`` behavior for this policy is to +assume that C++ 20 and newer files may import modules, and need to be scanned. + +This policy was introduced in CMake version 3.28. Use the +:command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly. +Unlike many policies, CMake version |release| does *not* warn +when this policy is not set and simply uses ``OLD`` behavior. + +.. include:: DEPRECATED.txt |