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.
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 @@
            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 @@
  */
 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 @@
     std::string const Uuid;
     std::string const Variable;
     std::string const Description;
+    std::vector<std::string> const TryCompileVariables;
     TryCompileCondition const ForwardThroughTryCompile;
     bool Warned;
   };