summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2024-03-12 17:12:59 (GMT)
committerBrad King <brad.king@kitware.com>2024-03-12 18:24:53 (GMT)
commit3a739d4dcb460a2c23b78649d477f6a91b825de6 (patch)
tree11a6ef1016e5ed68adf60426c0d8ce35d5ffd07b /Source
parent3677b2d916fb8d3ba5ff4eac0115f905b9727f9d (diff)
downloadCMake-3a739d4dcb460a2c23b78649d477f6a91b825de6.zip
CMake-3a739d4dcb460a2c23b78649d477f6a91b825de6.tar.gz
CMake-3a739d4dcb460a2c23b78649d477f6a91b825de6.tar.bz2
EXPORT_PACKAGE_DEPENDENCIES: Add experimental feature gate
Some design concerns have been raised after trying the 3.29 release candidates. Avoid committing to a stable public interface for now. Issue: #25767
Diffstat (limited to 'Source')
-rw-r--r--Source/cmExperimental.cxx9
-rw-r--r--Source/cmExperimental.h1
-rw-r--r--Source/cmExportCommand.cxx17
-rw-r--r--Source/cmInstallCommand.cxx8
4 files changed, 30 insertions, 5 deletions
diff --git a/Source/cmExperimental.cxx b/Source/cmExperimental.cxx
index d75879f..fb21f53 100644
--- a/Source/cmExperimental.cxx
+++ b/Source/cmExperimental.cxx
@@ -19,6 +19,15 @@ namespace {
* up-to-date.
*/
cmExperimental::FeatureData LookupTable[] = {
+ // ExportPackageDependencies
+ { "ExportPackageDependencies",
+ "1942b4fa-b2c5-4546-9385-83f254070067",
+ "CMAKE_EXPERIMENTAL_EXPORT_PACKAGE_DEPENDENCIES",
+ "CMake's EXPORT_PACKAGE_DEPENDENCIES support is experimental. It is meant "
+ "only for experimentation and feedback to CMake developers.",
+ {},
+ cmExperimental::TryCompileCondition::Always,
+ false },
// WindowsKernelModeDriver
{ "WindowsKernelModeDriver",
"5c2d848d-4efa-4529-a768-efd57171bf68",
diff --git a/Source/cmExperimental.h b/Source/cmExperimental.h
index e4c1448..5593c85 100644
--- a/Source/cmExperimental.h
+++ b/Source/cmExperimental.h
@@ -15,6 +15,7 @@ class cmExperimental
public:
enum class Feature
{
+ ExportPackageDependencies,
WindowsKernelModeDriver,
Sentinel,
diff --git a/Source/cmExportCommand.cxx b/Source/cmExportCommand.cxx
index 7d23c91..0cb0011 100644
--- a/Source/cmExportCommand.cxx
+++ b/Source/cmExportCommand.cxx
@@ -17,6 +17,7 @@
#include "cmArgumentParserTypes.h"
#include "cmCryptoHash.h"
#include "cmExecutionStatus.h"
+#include "cmExperimental.h"
#include "cmExportBuildAndroidMKGenerator.h"
#include "cmExportBuildFileGenerator.h"
#include "cmExportSet.h"
@@ -83,12 +84,20 @@ bool cmExportCommand(std::vector<std::string> const& args,
.Bind("CXX_MODULES_DIRECTORY"_s, &Arguments::CxxModulesDirectory);
if (args[0] == "EXPORT") {
- parser.Bind("EXPORT"_s, &Arguments::ExportSetName)
- .Bind("EXPORT_PACKAGE_DEPENDENCIES"_s,
- &Arguments::ExportPackageDependencies);
+ parser.Bind("EXPORT"_s, &Arguments::ExportSetName);
+ if (cmExperimental::HasSupportEnabled(
+ status.GetMakefile(),
+ cmExperimental::Feature::ExportPackageDependencies)) {
+ parser.Bind("EXPORT_PACKAGE_DEPENDENCIES"_s,
+ &Arguments::ExportPackageDependencies);
+ }
} else if (args[0] == "SETUP") {
parser.Bind("SETUP"_s, &Arguments::ExportSetName);
- parser.Bind("PACKAGE_DEPENDENCY"_s, &Arguments::PackageDependencyArgs);
+ if (cmExperimental::HasSupportEnabled(
+ status.GetMakefile(),
+ cmExperimental::Feature::ExportPackageDependencies)) {
+ parser.Bind("PACKAGE_DEPENDENCY"_s, &Arguments::PackageDependencyArgs);
+ }
parser.Bind("TARGET"_s, &Arguments::TargetArgs);
} else {
parser.Bind("TARGETS"_s, &Arguments::Targets);
diff --git a/Source/cmInstallCommand.cxx b/Source/cmInstallCommand.cxx
index e2755da..1567629 100644
--- a/Source/cmInstallCommand.cxx
+++ b/Source/cmInstallCommand.cxx
@@ -21,6 +21,7 @@
#include "cmArgumentParser.h"
#include "cmArgumentParserTypes.h"
#include "cmExecutionStatus.h"
+#include "cmExperimental.h"
#include "cmExportSet.h"
#include "cmFileSet.h"
#include "cmGeneratorExpression.h"
@@ -2061,7 +2062,12 @@ bool HandleExportMode(std::vector<std::string> const& args,
ica.Bind("EXPORT_LINK_INTERFACE_LIBRARIES"_s, exportOld);
ica.Bind("FILE"_s, filename);
ica.Bind("CXX_MODULES_DIRECTORY"_s, cxx_modules_directory);
- ica.Bind("EXPORT_PACKAGE_DEPENDENCIES"_s, exportPackageDependencies);
+
+ if (cmExperimental::HasSupportEnabled(
+ status.GetMakefile(),
+ cmExperimental::Feature::ExportPackageDependencies)) {
+ ica.Bind("EXPORT_PACKAGE_DEPENDENCIES"_s, exportPackageDependencies);
+ }
std::vector<std::string> unknownArgs;
ica.Parse(args, &unknownArgs);