summaryrefslogtreecommitdiffstats
path: root/Help/policy/CMP0155.rst
blob: 8b741cb889db78222891f733a223a781e5b50593 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
CMP0155
-------

.. versionadded:: 3.28

C++ sources in targets with at least C++20 are scanned for imports
when supported.

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 if the compiler
understands how to scan for their dependencies, 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