diff options
Diffstat (limited to 'Source/cmGeneratorTarget.cxx')
-rw-r--r-- | Source/cmGeneratorTarget.cxx | 76 |
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 { |