diff options
-rw-r--r-- | Source/cmExperimental.cxx | 18 | ||||
-rw-r--r-- | Source/cmExperimental.h | 11 |
2 files changed, 19 insertions, 10 deletions
diff --git a/Source/cmExperimental.cxx b/Source/cmExperimental.cxx index 0a746a9..8dc2b72 100644 --- a/Source/cmExperimental.cxx +++ b/Source/cmExperimental.cxx @@ -18,14 +18,7 @@ namespace { * Search for other instances to keep the documentation and test suite * up-to-date. */ - -struct FeatureData -{ - std::string const Uuid; - std::string const Variable; - std::string const Description; - bool Warned; -} LookupTable[] = { +cmExperimental::FeatureData LookupTable[] = { // CxxModuleCMakeApi { "bf70d4b0-9fb7-465c-9803-34014e70d112", "CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API", @@ -37,17 +30,22 @@ static_assert(sizeof(LookupTable) / sizeof(LookupTable[0]) == static_cast<size_t>(cmExperimental::Feature::Sentinel), "Experimental feature lookup table mismatch"); -FeatureData& DataForFeature(cmExperimental::Feature f) +cmExperimental::FeatureData& DataForFeature(cmExperimental::Feature f) { assert(f != cmExperimental::Feature::Sentinel); return LookupTable[static_cast<size_t>(f)]; } } +const cmExperimental::FeatureData& cmExperimental::DataForFeature(Feature f) +{ + return ::DataForFeature(f); +} + bool cmExperimental::HasSupportEnabled(cmMakefile const& mf, Feature f) { bool enabled = false; - auto& data = DataForFeature(f); + auto& data = ::DataForFeature(f); auto value = mf.GetDefinition(data.Variable); if (value == data.Uuid) { diff --git a/Source/cmExperimental.h b/Source/cmExperimental.h index 26e0d17..97eb586 100644 --- a/Source/cmExperimental.h +++ b/Source/cmExperimental.h @@ -5,6 +5,8 @@ #include "cmConfigure.h" // IWYU pragma: keep +#include <string> + class cmMakefile; class cmExperimental @@ -17,5 +19,14 @@ public: Sentinel, }; + struct FeatureData + { + std::string const Uuid; + std::string const Variable; + std::string const Description; + bool Warned; + }; + + static const FeatureData& DataForFeature(Feature f); static bool HasSupportEnabled(cmMakefile const& mf, Feature f); }; |