cmExperimental: add an experimental feature to handle C++ modules

This commit is contained in:
Ben Boeckel
2022-05-24 17:20:42 -04:00
parent fb289dfcd9
commit ff30a5397d
3 changed files with 27 additions and 1 deletions

View File

@@ -7,6 +7,23 @@ See documentation on `CMake Development`_ for more information.
.. _`CMake Development`: README.rst
Features are gated behind ``CMAKE_EXPERIMENTAL_`` variables which must be set
to specific values in order to enable their gated behaviors. Note that the
specific values will change over time to reinforce their experimental nature.
When used, a warning will be generated to indicate that an experimental
feature is in use and that the affected behavior in the project is not part of
CMake's stability guarantees.
C++20 Module APIs
=================
Variable: ``CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API``
Value: ``17be90bd-a850-44e0-be50-448de847d652``
In order to support C++20 modules, there are a number of behaviors that have
CMake APIs to provide the required features to build and export them from a
project.
C++20 Module Dependencies
=========================

View File

@@ -25,7 +25,14 @@ struct FeatureData
std::string const Variable;
std::string const Description;
bool Warned;
} LookupTable[] = {};
} LookupTable[] = {
// CxxModuleCMakeApi
{ "17be90bd-a850-44e0-be50-448de847d652",
"CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API",
"CMake's C++ module support is experimental. It is meant only for "
"experimentation and feedback to CMake developers.",
false },
};
static_assert(sizeof(LookupTable) / sizeof(LookupTable[0]) ==
static_cast<size_t>(cmExperimental::Feature::Sentinel),
"Experimental feature lookup table mismatch");

View File

@@ -12,6 +12,8 @@ class cmExperimental
public:
enum class Feature
{
CxxModuleCMakeApi,
Sentinel,
};