summaryrefslogtreecommitdiffstats
path: root/Source/cmGeneratorTarget.cxx
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2015-08-04 21:48:58 (GMT)
committerStephen Kelly <steveire@gmail.com>2015-08-26 17:46:10 (GMT)
commitd051086ccec5cd4b381cf47afb0e7fe962ed4c0b (patch)
treef75c2f09a92e0d3a15cb3849bf5d8c84a3ab8cc2 /Source/cmGeneratorTarget.cxx
parentdb4cb92bda8b43c3d66d27533622bb802e823589 (diff)
downloadCMake-d051086ccec5cd4b381cf47afb0e7fe962ed4c0b.zip
CMake-d051086ccec5cd4b381cf47afb0e7fe962ed4c0b.tar.gz
CMake-d051086ccec5cd4b381cf47afb0e7fe962ed4c0b.tar.bz2
cmGeneratorTarget: Move compile features processing from cmTarget.
Diffstat (limited to 'Source/cmGeneratorTarget.cxx')
-rw-r--r--Source/cmGeneratorTarget.cxx76
1 files changed, 75 insertions, 1 deletions
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 77e352f..5a67c15 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -262,7 +262,8 @@ cmGeneratorTarget::cmGeneratorTarget(cmTarget* t, cmLocalGenerator* lg)
SourceFileFlagsConstructed(false),
PolicyWarnedCMP0022(false),
DebugIncludesDone(false),
- DebugCompileOptionsDone(false)
+ DebugCompileOptionsDone(false),
+ DebugCompileFeaturesDone(false)
{
this->Makefile = this->Target->GetMakefile();
this->LocalGenerator = lg;
@@ -277,12 +278,18 @@ cmGeneratorTarget::cmGeneratorTarget(cmTarget* t, cmLocalGenerator* lg)
t->GetCompileOptionsEntries(),
t->GetCompileOptionsBacktraces(),
this->CompileOptionsEntries);
+
+ CreatePropertyGeneratorExpressions(
+ t->GetCompileFeaturesEntries(),
+ t->GetCompileFeaturesBacktraces(),
+ this->CompileFeaturesEntries);
}
cmGeneratorTarget::~cmGeneratorTarget()
{
cmDeleteAll(this->IncludeDirectoriesEntries);
cmDeleteAll(this->CompileOptionsEntries);
+ cmDeleteAll(this->CompileFeaturesEntries);
cmDeleteAll(this->LinkInformation);
this->LinkInformation.clear();
}
@@ -2371,6 +2378,73 @@ void cmGeneratorTarget::GetCompileOptions(std::vector<std::string> &result,
}
//----------------------------------------------------------------------------
+static void processCompileFeatures(cmGeneratorTarget const* tgt,
+ const std::vector<cmGeneratorTarget::TargetPropertyEntry*> &entries,
+ std::vector<std::string> &options,
+ UNORDERED_SET<std::string> &uniqueOptions,
+ cmGeneratorExpressionDAGChecker *dagChecker,
+ const std::string& config, bool debugOptions)
+{
+ processCompileOptionsInternal(tgt, entries, options, uniqueOptions,
+ dagChecker, config, debugOptions, "features",
+ std::string());
+}
+
+//----------------------------------------------------------------------------
+void cmGeneratorTarget::GetCompileFeatures(std::vector<std::string> &result,
+ const std::string& config) const
+{
+ UNORDERED_SET<std::string> uniqueFeatures;
+
+ cmGeneratorExpressionDAGChecker dagChecker(this->GetName(),
+ "COMPILE_FEATURES",
+ 0, 0);
+
+ std::vector<std::string> debugProperties;
+ const char *debugProp =
+ this->Makefile->GetDefinition("CMAKE_DEBUG_TARGET_PROPERTIES");
+ if (debugProp)
+ {
+ cmSystemTools::ExpandListArgument(debugProp, debugProperties);
+ }
+
+ bool debugFeatures = !this->DebugCompileFeaturesDone
+ && std::find(debugProperties.begin(),
+ debugProperties.end(),
+ "COMPILE_FEATURES")
+ != debugProperties.end();
+
+ if (this->Makefile->IsConfigured())
+ {
+ this->DebugCompileFeaturesDone = true;
+ }
+
+ processCompileFeatures(this,
+ this->CompileFeaturesEntries,
+ result,
+ uniqueFeatures,
+ &dagChecker,
+ config,
+ debugFeatures);
+
+ std::vector<cmGeneratorTarget::TargetPropertyEntry*>
+ linkInterfaceCompileFeaturesEntries;
+ AddInterfaceEntries(
+ this, config, "INTERFACE_COMPILE_FEATURES",
+ linkInterfaceCompileFeaturesEntries);
+
+ processCompileFeatures(this,
+ linkInterfaceCompileFeaturesEntries,
+ result,
+ uniqueFeatures,
+ &dagChecker,
+ config,
+ debugFeatures);
+
+ cmDeleteAll(linkInterfaceCompileFeaturesEntries);
+}
+
+//----------------------------------------------------------------------------
void cmGeneratorTarget::GenerateTargetManifest(
const std::string& config) const
{