diff options
author | Deniz Bahadir <dbahadir@benocs.com> | 2020-10-22 21:00:49 (GMT) |
---|---|---|
committer | Deniz Bahadir <dbahadir@benocs.com> | 2020-10-22 21:03:05 (GMT) |
commit | cd33bfcad57eca7c32d3f8e3260d9a6682c5d516 (patch) | |
tree | 601bedde4189329bc3559a6a4598d0a45995960b /Source | |
parent | 609122007dc074739b394d2f70f674bbccca6073 (diff) | |
download | CMake-cd33bfcad57eca7c32d3f8e3260d9a6682c5d516.zip CMake-cd33bfcad57eca7c32d3f8e3260d9a6682c5d516.tar.gz CMake-cd33bfcad57eca7c32d3f8e3260d9a6682c5d516.tar.bz2 |
add_custom_command: Properly recognize if sources depend on config
Fixes: #21349
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmGeneratorTarget.cxx | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index bdea9fa..3560739 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -3098,12 +3098,17 @@ void cmTargetTraceDependencies::CheckCustomCommand(cmCustomCommand const& cc) } // Check for target references in generator expressions. - for (std::string const& cl : cCmdLine) { - const std::unique_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(cl); - cge->SetQuiet(true); - cge->Evaluate(this->GeneratorTarget->GetLocalGenerator(), ""); - std::set<cmGeneratorTarget*> geTargets = cge->GetTargets(); - targets.insert(geTargets.begin(), geTargets.end()); + std::vector<std::string> const& configs = + this->Makefile->GetGeneratorConfigs(cmMakefile::IncludeEmptyConfig); + for (std::string const& c : configs) { + for (std::string const& cl : cCmdLine) { + const std::unique_ptr<cmCompiledGeneratorExpression> cge = + ge.Parse(cl); + cge->SetQuiet(true); + cge->Evaluate(this->GeneratorTarget->GetLocalGenerator(), c); + std::set<cmGeneratorTarget*> geTargets = cge->GetTargets(); + targets.insert(geTargets.begin(), geTargets.end()); + } } } |