cmExperimental: gate build database support behind a flag

Given that the feature currently only supports C++ sources and is not
formally accepted by ISO yet, gate it behind a flag.
This commit is contained in:
Ben Boeckel
2024-08-07 14:15:50 -04:00
parent 23cbeb5035
commit e77655555c
13 changed files with 74 additions and 0 deletions
+21
View File
@@ -80,3 +80,24 @@ When activated, this experimental feature provides the following:
.. _CPS: https://cps-org.github.io/cps/
.. |CPS| replace:: Common Package Specification
Build database support
======================
In order to activate support for exporting build databases, set
* variable ``CMAKE_EXPERIMENTAL_EXPORT_BUILD_DATABASE`` to
* value ``4bd552e2-b7fb-429a-ab23-c83ef53f3f13``.
This UUID may change in future versions of CMake. Be sure to use the value
documented here by the source tree of the version of CMake with which you are
experimenting.
When activated, this experimental feature provides the following:
* The :prop_tgt:`EXPORT_BUILD_DATABASE` target property and its initializing
variable :variable:`CMAKE_EXPORT_BUILD_DATABASE` and environment variable
:envvar:`CMAKE_EXPORT_BUILD_DATABASE`.
* Targets with the property set to a true value will have their C++ build
information exported to the build database.
@@ -9,3 +9,9 @@ The default value for :variable:`CMAKE_EXPORT_BUILD_DATABASE` when there is no
explicit configuration given on the first run while creating a new build tree.
On later runs in an existing build tree the value persists in the cache as
:variable:`CMAKE_EXPORT_BUILD_DATABASE`.
.. note ::
This variable is meaningful only when experimental support for build
databases has been enabled by the
``CMAKE_EXPERIMENTAL_EXPORT_BUILD_DATABASE`` gate.
+6
View File
@@ -7,3 +7,9 @@ Enable/Disable output of a build database for a target.
This property is initialized by the value of the variable
:variable:`CMAKE_EXPORT_BUILD_DATABASE` if it is set when a target is created.
.. note ::
This property is meaningful only when experimental support for build
databases has been enabled by the
``CMAKE_EXPERIMENTAL_EXPORT_BUILD_DATABASE`` gate.
@@ -3,6 +3,12 @@ CMAKE_EXPORT_BUILD_DATABASE
.. versionadded:: 3.31
.. note ::
This variable is meaningful only when experimental support for build
databases has been enabled by the
``CMAKE_EXPERIMENTAL_EXPORT_BUILD_DATABASE`` gate.
Enable/Disable output of module compile commands during the build.
If enabled, generates a ``build_database.json`` file containing the