summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBen Boeckel <ben.boeckel@kitware.com>2023-07-19 20:40:52 (GMT)
committerBen Boeckel <ben.boeckel@kitware.com>2023-07-31 15:37:47 (GMT)
commit1a538ae07c5a859158e603c6075b352c5f5e294e (patch)
treea74207da97cbbd35fd79b70b66453810d873faeb /Source
parent04300579ddcb8d6bdd6e653b06b60bae378826dc (diff)
downloadCMake-1a538ae07c5a859158e603c6075b352c5f5e294e.zip
CMake-1a538ae07c5a859158e603c6075b352c5f5e294e.tar.gz
CMake-1a538ae07c5a859158e603c6075b352c5f5e294e.tar.bz2
cmExperimental: use an `enum` for whether to forward to try_compile
Diffstat (limited to 'Source')
-rw-r--r--Source/cmCoreTryCompile.cxx3
-rw-r--r--Source/cmExperimental.cxx6
-rw-r--r--Source/cmExperimental.h8
3 files changed, 12 insertions, 5 deletions
diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx
index cddbb9b..74f0320 100644
--- a/Source/cmCoreTryCompile.cxx
+++ b/Source/cmCoreTryCompile.cxx
@@ -1077,7 +1077,8 @@ cm::optional<cmTryCompileResult> cmCoreTryCompile::TryCompileCode(
i++) {
auto const& data = cmExperimental::DataForFeature(
static_cast<cmExperimental::Feature>(i));
- if (data.ForwardThroughTryCompile) {
+ if (data.ForwardThroughTryCompile ==
+ cmExperimental::TryCompileCondition::Always) {
vars.insert(data.Variable);
}
}
diff --git a/Source/cmExperimental.cxx b/Source/cmExperimental.cxx
index 51c174e..fcd215c 100644
--- a/Source/cmExperimental.cxx
+++ b/Source/cmExperimental.cxx
@@ -24,14 +24,14 @@ cmExperimental::FeatureData LookupTable[] = {
"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, // https://gitlab.kitware.com/cmake/cmake/-/issues/25097
- false },
+ // https://gitlab.kitware.com/cmake/cmake/-/issues/25097
+ cmExperimental::TryCompileCondition::Never, false },
// WindowsKernelModeDriver
{ "WindowsKernelModeDriver", "5c2d848d-4efa-4529-a768-efd57171bf68",
"CMAKE_EXPERIMENTAL_WINDOWS_KERNEL_MODE_DRIVER",
"CMake's Windows kernel-mode driver support is experimental. It is meant "
"only for experimentation and feedback to CMake developers.",
- true, false },
+ cmExperimental::TryCompileCondition::Always, false },
};
static_assert(sizeof(LookupTable) / sizeof(LookupTable[0]) ==
static_cast<size_t>(cmExperimental::Feature::Sentinel),
diff --git a/Source/cmExperimental.h b/Source/cmExperimental.h
index 3374ba8..fa1982e 100644
--- a/Source/cmExperimental.h
+++ b/Source/cmExperimental.h
@@ -20,13 +20,19 @@ public:
Sentinel,
};
+ enum class TryCompileCondition
+ {
+ Always,
+ Never,
+ };
+
struct FeatureData
{
std::string const Name;
std::string const Uuid;
std::string const Variable;
std::string const Description;
- bool const ForwardThroughTryCompile;
+ TryCompileCondition const ForwardThroughTryCompile;
bool Warned;
};