summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBen Boeckel <ben.boeckel@kitware.com>2023-07-19 20:42:37 (GMT)
committerBen Boeckel <ben.boeckel@kitware.com>2023-07-31 15:37:47 (GMT)
commitaad9033b5640b62ab47c0be926b8e05d66b735c0 (patch)
tree8e3052bf554c07f6dfd5445d4eeec76f26755fa9 /Source
parentf6cf4332562adcacf590d9939d6ab591f049cf59 (diff)
downloadCMake-aad9033b5640b62ab47c0be926b8e05d66b735c0.zip
CMake-aad9033b5640b62ab47c0be926b8e05d66b735c0.tar.gz
CMake-aad9033b5640b62ab47c0be926b8e05d66b735c0.tar.bz2
cmExperimental: support forwarding associated variables to `try_compile`
Other variables may be needed to make experimental features actually work. List them with the experimental flag.
Diffstat (limited to 'Source')
-rw-r--r--Source/cmCoreTryCompile.cxx3
-rw-r--r--Source/cmExperimental.cxx16
-rw-r--r--Source/cmExperimental.h2
3 files changed, 17 insertions, 4 deletions
diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx
index 7045aa7..7773569 100644
--- a/Source/cmCoreTryCompile.cxx
+++ b/Source/cmCoreTryCompile.cxx
@@ -1084,6 +1084,9 @@ cm::optional<cmTryCompileResult> cmCoreTryCompile::TryCompileCode(
arguments.CMakeInternal != "ABI"_s &&
arguments.CMakeInternal != "FEATURE_TESTING"_s)) {
vars.insert(data.Variable);
+ for (auto const& var : data.TryCompileVariables) {
+ vars.insert(var);
+ }
}
}
diff --git a/Source/cmExperimental.cxx b/Source/cmExperimental.cxx
index 68bd964..b971a26 100644
--- a/Source/cmExperimental.cxx
+++ b/Source/cmExperimental.cxx
@@ -20,17 +20,25 @@ namespace {
*/
cmExperimental::FeatureData LookupTable[] = {
// CxxModuleCMakeApi
- { "CxxModuleCMakeApi", "bf70d4b0-9fb7-465c-9803-34014e70d112",
+ { "CxxModuleCMakeApi",
+ "bf70d4b0-9fb7-465c-9803-34014e70d112",
"CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API",
"CMake's C++ module support is experimental. It is meant only for "
"experimentation and feedback to CMake developers.",
- cmExperimental::TryCompileCondition::SkipCompilerChecks, false },
+ { "CMAKE_EXPERIMENTAL_CXX_SCANDEP_SOURCE",
+ "CMAKE_EXPERIMENTAL_CXX_MODULE_MAP_FORMAT",
+ "CMAKE_EXPERIMENTAL_CXX_MODULE_MAP_FLAG" },
+ cmExperimental::TryCompileCondition::SkipCompilerChecks,
+ false },
// WindowsKernelModeDriver
- { "WindowsKernelModeDriver", "5c2d848d-4efa-4529-a768-efd57171bf68",
+ { "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.",
- cmExperimental::TryCompileCondition::Always, 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 0768146..c958ab6 100644
--- a/Source/cmExperimental.h
+++ b/Source/cmExperimental.h
@@ -6,6 +6,7 @@
#include "cmConfigure.h" // IWYU pragma: keep
#include <string>
+#include <vector>
class cmMakefile;
@@ -33,6 +34,7 @@ public:
std::string const Uuid;
std::string const Variable;
std::string const Description;
+ std::vector<std::string> const TryCompileVariables;
TryCompileCondition const ForwardThroughTryCompile;
bool Warned;
};