summaryrefslogtreecommitdiffstats
path: root/Source/cmGeneratorTarget.cxx
diff options
context:
space:
mode:
authorBen Boeckel <ben.boeckel@kitware.com>2024-04-10 13:12:24 (GMT)
committerBen Boeckel <ben.boeckel@kitware.com>2024-04-12 15:46:39 (GMT)
commit15bbd1d9b890645f3786f1b24d0d7651cbc2e807 (patch)
tree20aca1382019ac51f81c2a499b12bcf1ead89998 /Source/cmGeneratorTarget.cxx
parentf80c60df02854b9443a0f73770d2ef7a1bcd72d5 (diff)
downloadCMake-15bbd1d9b890645f3786f1b24d0d7651cbc2e807.zip
CMake-15bbd1d9b890645f3786f1b24d0d7651cbc2e807.tar.gz
CMake-15bbd1d9b890645f3786f1b24d0d7651cbc2e807.tar.bz2
Experimental: add an experimental feature gate for `import std`
Diffstat (limited to 'Source/cmGeneratorTarget.cxx')
-rw-r--r--Source/cmGeneratorTarget.cxx9
1 files changed, 9 insertions, 0 deletions
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 1dba976..be82099 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -32,6 +32,7 @@
#include "cmCustomCommandGenerator.h"
#include "cmCxxModuleUsageEffects.h"
#include "cmEvaluatedTargetProperty.h"
+#include "cmExperimental.h"
#include "cmFileSet.h"
#include "cmFileTimes.h"
#include "cmGeneratedFileStream.h"
@@ -8502,6 +8503,14 @@ bool cmGeneratorTarget::ApplyCXXStdTargets()
break;
}
+ // Check the experimental feature here as well. A toolchain may have
+ // provided the target and skipped the check in the toolchain preparation
+ // logic.
+ if (!cmExperimental::HasSupportEnabled(
+ *this->Makefile, cmExperimental::Feature::CxxImportStd)) {
+ break;
+ }
+
this->Target->AppendProperty(
"LINK_LIBRARIES",
cmStrCat("$<BUILD_LOCAL_INTERFACE:$<$<CONFIG:", config, ">:", targetName,