summaryrefslogtreecommitdiffstats
path: root/Help/manual
diff options
context:
space:
mode:
authorBen Boeckel <ben.boeckel@kitware.com>2023-09-28 00:31:20 (GMT)
committerBen Boeckel <ben.boeckel@kitware.com>2023-10-02 14:17:31 (GMT)
commit197a6bf1714267ad536f27fef5a24cbe6fd3fcff (patch)
treed1f7b455e2d23dac4330999f423f169986bd8418 /Help/manual
parent5eb7bd641a909925c6341819bc7900300776924f (diff)
downloadCMake-197a6bf1714267ad536f27fef5a24cbe6fd3fcff.zip
CMake-197a6bf1714267ad536f27fef5a24cbe6fd3fcff.tar.gz
CMake-197a6bf1714267ad536f27fef5a24cbe6fd3fcff.tar.bz2
cxxmodules: rework control logic for scanning regular C++ sources
Now that scanning support is no longer experimental, the logic for whether or not to scan C++ 20 sources is now important because all projects are now exposted to the logic. Make the scanning rules explicit in the documentation and rework the queries to localize all of the associated logic. A policy to handle the ultimate fallback logic will be implemented in a following commit.
Diffstat (limited to 'Help/manual')
-rw-r--r--Help/manual/cmake-cxxmodules.7.rst17
1 files changed, 17 insertions, 0 deletions
diff --git a/Help/manual/cmake-cxxmodules.7.rst b/Help/manual/cmake-cxxmodules.7.rst
index 91acae1..a082f58 100644
--- a/Help/manual/cmake-cxxmodules.7.rst
+++ b/Help/manual/cmake-cxxmodules.7.rst
@@ -12,6 +12,23 @@ to scan source files for module dependencies during the build, collates
scanning results to infer ordering constraints, and tells the build tool
how to dynamically update the build graph.
+Scanning Control
+================
+
+Whether or not sources get scanned for C++ module usage is dependent on the
+following queries. The first query that provides a yes/no answer is used.
+
+- If the source file belongs to a file set of type ``CXX_MODULES``, it will
+ be scanned.
+- If the target does not use at least C++ 20, it will not be scanned.
+- If the source file is not the language ``CXX``, it will not be scanned.
+- If the :prop_sf:`CXX_SCAN_FOR_MODULES` source file property is set, its
+ value will be used.
+- If the :prop_tgt:`CXX_SCAN_FOR_MODULES` target property is set, its value
+ will be used. Set the :variable:`CMAKE_CXX_SCAN_FOR_MODULES` variable
+ to initialize this property on all targets as they are created.
+- Otherwise the source will be scanned.
+
Compiler Support
================