1 /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
2 file Copyright.txt or https://cmake.org/licensing for details. */
4 #include "cmExperimental.h"
10 #include "cmMakefile.h"
11 #include "cmMessageType.h"
17 * The `Uuid` fields of these objects should change periodically.
18 * Search for other instances to keep the documentation and test suite
24 std::string const Uuid;
25 std::string const Variable;
26 std::string const Description;
30 { "3c375311-a3c9-4396-a187-3227ef642046",
31 "CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API",
32 "CMake's C++ module support is experimental. It is meant only for "
33 "experimentation and feedback to CMake developers.",
36 static_assert(sizeof(LookupTable) / sizeof(LookupTable[0]) ==
37 static_cast<size_t>(cmExperimental::Feature::Sentinel),
38 "Experimental feature lookup table mismatch");
40 FeatureData& DataForFeature(cmExperimental::Feature f)
42 assert(f != cmExperimental::Feature::Sentinel);
43 return LookupTable[static_cast<size_t>(f)];
47 bool cmExperimental::HasSupportEnabled(cmMakefile const& mf, Feature f)
50 auto& data = DataForFeature(f);
52 auto value = mf.GetDefinition(data.Variable);
53 if (value == data.Uuid) {
57 if (enabled && !data.Warned) {
58 mf.IssueMessage(MessageType::AUTHOR_WARNING, data.Description);