diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx index 4a7a76027..d6440acd8 100644 --- a/Source/cmExportFileGenerator.cxx +++ b/Source/cmExportFileGenerator.cxx @@ -457,7 +457,7 @@ void cmExportFileGenerator::PopulateIncludeDirectoriesInterface( this->ReplaceInstallPrefix(dirs); cmsys::auto_ptr cge = ge.Parse(dirs); std::string exportDirs = cge->Evaluate(target->GetLocalGenerator(), "", - false, target->Target); + false, target); if (cge->GetHadContextSensitiveCondition()) { diff --git a/Source/cmExportTryCompileFileGenerator.cxx b/Source/cmExportTryCompileFileGenerator.cxx index 3d302d042..f8dbe314c 100644 --- a/Source/cmExportTryCompileFileGenerator.cxx +++ b/Source/cmExportTryCompileFileGenerator.cxx @@ -78,10 +78,11 @@ std::string cmExportTryCompileFileGenerator::FindTargets( cmGeneratorTarget* gtgt = tgt->GetMakefile()->GetGlobalGenerator()->GetGeneratorTarget(tgt); + cmGeneratorTarget gDummyHead(&dummyHead, gtgt->GetLocalGenerator()); std::string result = cge->Evaluate(gtgt->GetLocalGenerator(), this->Config, - false, &dummyHead, - gtgt->Target, &dagChecker); + false, &gDummyHead, + gtgt, &dagChecker); const std::set &allTargets = cge->GetAllTargetsSeen(); for(std::set::const_iterator li = allTargets.begin(); diff --git a/Source/cmGeneratorExpression.cxx b/Source/cmGeneratorExpression.cxx index ef1679f68..d9f67f20f 100644 --- a/Source/cmGeneratorExpression.cxx +++ b/Source/cmGeneratorExpression.cxx @@ -50,7 +50,7 @@ cmGeneratorExpression::~cmGeneratorExpression() //---------------------------------------------------------------------------- const char *cmCompiledGeneratorExpression::Evaluate(cmLocalGenerator* lg, const std::string& config, bool quiet, - cmTarget const* headTarget, + const cmGeneratorTarget* headTarget, cmGeneratorExpressionDAGChecker *dagChecker, std::string const& language) const { @@ -66,8 +66,8 @@ const char *cmCompiledGeneratorExpression::Evaluate(cmLocalGenerator* lg, //---------------------------------------------------------------------------- const char *cmCompiledGeneratorExpression::Evaluate( cmLocalGenerator* lg, const std::string& config, bool quiet, - cmTarget const* headTarget, - cmTarget const* currentTarget, + const cmGeneratorTarget* headTarget, + const cmGeneratorTarget* currentTarget, cmGeneratorExpressionDAGChecker *dagChecker, std::string const& language) const { diff --git a/Source/cmGeneratorExpression.h b/Source/cmGeneratorExpression.h index 8843e0a11..d64d6baa1 100644 --- a/Source/cmGeneratorExpression.h +++ b/Source/cmGeneratorExpression.h @@ -20,6 +20,7 @@ #include class cmTarget; +class cmGeneratorTarget; class cmLocalGenerator; class cmListFileBacktrace; @@ -80,13 +81,13 @@ class cmCompiledGeneratorExpression public: const char* Evaluate(cmLocalGenerator* lg, const std::string& config, bool quiet = false, - cmTarget const* headTarget = 0, - cmTarget const* currentTarget = 0, + cmGeneratorTarget const* headTarget = 0, + cmGeneratorTarget const* currentTarget = 0, cmGeneratorExpressionDAGChecker *dagChecker = 0, std::string const& language = std::string()) const; const char* Evaluate(cmLocalGenerator* lg, const std::string& config, bool quiet, - cmTarget const* headTarget, + cmGeneratorTarget const* headTarget, cmGeneratorExpressionDAGChecker *dagChecker, std::string const& language = std::string()) const; diff --git a/Source/cmGeneratorExpressionContext.cxx b/Source/cmGeneratorExpressionContext.cxx index cd056a0b0..4daf4e9bb 100644 --- a/Source/cmGeneratorExpressionContext.cxx +++ b/Source/cmGeneratorExpressionContext.cxx @@ -11,11 +11,12 @@ ============================================================================*/ #include "cmGeneratorExpressionContext.h" +#include "cmGeneratorTarget.h" cmGeneratorExpressionContext::cmGeneratorExpressionContext( cmLocalGenerator* lg, std::string const& config, - bool quiet, cmTarget const* headTarget, - cmTarget const* currentTarget, + bool quiet, cmGeneratorTarget const* headTarget, + const cmGeneratorTarget* currentTarget, bool evaluateForBuildsystem, cmListFileBacktrace const& backtrace, std::string const& language) @@ -23,8 +24,8 @@ cmGeneratorExpressionContext::cmGeneratorExpressionContext( LG(lg), Config(config), Language(language), - HeadTarget(headTarget), - CurrentTarget(currentTarget), + HeadTarget(headTarget ? headTarget->Target : 0), + CurrentTarget(currentTarget ? currentTarget->Target : 0), Quiet(quiet), HadError(false), HadContextSensitiveCondition(false), diff --git a/Source/cmGeneratorExpressionContext.h b/Source/cmGeneratorExpressionContext.h index 5b6507d6f..bbf0fcfec 100644 --- a/Source/cmGeneratorExpressionContext.h +++ b/Source/cmGeneratorExpressionContext.h @@ -19,14 +19,15 @@ #include class cmTarget; +class cmGeneratorTarget; class cmLocalGenerator; //---------------------------------------------------------------------------- struct cmGeneratorExpressionContext { cmGeneratorExpressionContext(cmLocalGenerator* lg, std::string const& config, - bool quiet, cmTarget const* headTarget, - cmTarget const* currentTarget, + bool quiet, const cmGeneratorTarget* headTarget, + cmGeneratorTarget const* currentTarget, bool evaluateForBuildsystem, cmListFileBacktrace const& backtrace, std::string const& language); diff --git a/Source/cmGeneratorExpressionNode.cxx b/Source/cmGeneratorExpressionNode.cxx index 61852ab48..2797d108e 100644 --- a/Source/cmGeneratorExpressionNode.cxx +++ b/Source/cmGeneratorExpressionNode.cxx @@ -19,7 +19,8 @@ std::string cmGeneratorExpressionNode::EvaluateDependentExpression( std::string const& prop, cmLocalGenerator *lg, cmGeneratorExpressionContext *context, - cmTarget const* headTarget, cmTarget const* currentTarget, + cmGeneratorTarget const* headTarget, + cmGeneratorTarget const* currentTarget, cmGeneratorExpressionDAGChecker *dagChecker) { cmGeneratorExpression ge(context->Backtrace); @@ -862,8 +863,8 @@ getLinkedTargetsContent( cmGeneratorExpressionNode::EvaluateDependentExpression(depString, target->GetLocalGenerator(), context, - headTarget->Target, - target->Target, dagChecker); + headTarget, + target, dagChecker); } linkedTargetsContent = cmGeneratorExpression::StripEmptyListElements(linkedTargetsContent); @@ -1215,9 +1216,11 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode } if(!interfacePropertyName.empty()) { + cmGeneratorTarget* gHeadTarget = + context->LG->GetGlobalGenerator()->GetGeneratorTarget(headTarget); std::string result = this->EvaluateDependentExpression(prop, context->LG, context, - headTarget, target, &dagChecker); + gHeadTarget, gtgt, &dagChecker); if (!linkedTargetsContent.empty()) { result += (result.empty() ? "" : ";") + linkedTargetsContent; diff --git a/Source/cmGeneratorExpressionNode.h b/Source/cmGeneratorExpressionNode.h index 22b65854f..db65db14c 100644 --- a/Source/cmGeneratorExpressionNode.h +++ b/Source/cmGeneratorExpressionNode.h @@ -56,7 +56,8 @@ struct cmGeneratorExpressionNode static std::string EvaluateDependentExpression( std::string const& prop, cmLocalGenerator *lg, cmGeneratorExpressionContext *context, - cmTarget const* headTarget, cmTarget const* currentTarget, + const cmGeneratorTarget* headTarget, + const cmGeneratorTarget* currentTarget, cmGeneratorExpressionDAGChecker *dagChecker); static const cmGeneratorExpressionNode* GetNode( diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index 04b0d1fa7..6033efe22 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -524,8 +524,8 @@ static void handleSystemIncludesDep(cmLocalGenerator *lg, cmGeneratorExpression ge; cmSystemTools::ExpandListArgument(ge.Parse(dirs) ->Evaluate(lg, - config, false, headTarget->Target, - depTgt->Target, dagChecker), result); + config, false, headTarget, + depTgt, dagChecker), result); } if (!depTgt->IsImported() || excludeImported) { @@ -538,8 +538,8 @@ static void handleSystemIncludesDep(cmLocalGenerator *lg, cmGeneratorExpression ge; cmSystemTools::ExpandListArgument(ge.Parse(dirs) ->Evaluate(lg, - config, false, headTarget->Target, - depTgt->Target, dagChecker), result); + config, false, headTarget, + depTgt, dagChecker), result); } } @@ -880,7 +880,7 @@ bool cmGeneratorTarget::IsSystemIncludeDirectory(const std::string& dir, cmGeneratorExpression ge; cmSystemTools::ExpandListArgument(ge.Parse(*it) ->Evaluate(this->LocalGenerator, - config, false, this->Target, + config, false, this, &dagChecker), result); } @@ -889,8 +889,7 @@ bool cmGeneratorTarget::IsSystemIncludeDirectory(const std::string& dir, for(std::vector::const_iterator li = deps.begin(), le = deps.end(); li != le; ++li) { - handleSystemIncludesDep(this->LocalGenerator, *li, - config, this, + handleSystemIncludesDep(this->LocalGenerator, *li, config, this, &dagChecker, result, excludeImported); } @@ -966,8 +965,8 @@ static bool processSources(cmGeneratorTarget const* tgt, tgt->GetLocalGenerator(), config, false, - tgt->Target, - tgt->Target, + tgt, + tgt, dagChecker), entrySources); @@ -2059,7 +2058,7 @@ void cmGeneratorTarget::GetAutoUicOptions(std::vector &result, ->Evaluate(this->LocalGenerator, config, false, - this->Target, + this, &dagChecker), result); } @@ -2544,7 +2543,7 @@ static void processIncludeDirectories(cmGeneratorTarget const* tgt, tgt->GetLocalGenerator(), config, false, - tgt->Target, + tgt, dagChecker, language), entryIncludes); @@ -2755,7 +2754,7 @@ static void processCompileOptionsInternal(cmGeneratorTarget const* tgt, tgt->GetLocalGenerator(), config, false, - tgt->Target, + tgt, dagChecker, language), entryOptions); @@ -4455,8 +4454,8 @@ void cmGeneratorTarget::ExpandLinkItems(std::string const& prop, this->LocalGenerator, config, false, - headTarget->Target, - this->Target, &dagChecker), libs); + headTarget, + this, &dagChecker), libs); this->LookupLinkItems(libs, items); hadHeadSensitiveCondition = cge->GetHadHeadSensitiveCondition(); } @@ -5347,8 +5346,7 @@ void cmGeneratorTarget::ComputeLinkImplementationLibraries( cmsys::auto_ptr const cge = ge.Parse(*le); std::string const evaluated = - cge->Evaluate(this->LocalGenerator, config, false, - head->Target, &dagChecker); + cge->Evaluate(this->LocalGenerator, config, false, head, &dagChecker); cmSystemTools::ExpandListArgument(evaluated, llibs); if(cge->GetHadHeadSensitiveCondition()) { diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx index b8966594c..abcda2131 100644 --- a/Source/cmMakefileTargetGenerator.cxx +++ b/Source/cmMakefileTargetGenerator.cxx @@ -149,7 +149,9 @@ void cmMakefileTargetGenerator::WriteTargetBuildRules() cmSystemTools::ExpandListArgument(cge->Evaluate(this->LocalGenerator, config, - false, this->Target, 0, 0), + false, + this->GeneratorTarget, + 0, 0), this->CleanFiles); }