diff options
author | Brad King <brad.king@kitware.com> | 2020-09-01 18:05:47 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2020-09-01 18:05:47 (GMT) |
commit | 8c60c49ae2ac24915931708435f632e66b713f4b (patch) | |
tree | b314f42a72b3b539b77ccdf2a641a231c7d34b2f /Source/cmGlobalXCodeGenerator.cxx | |
parent | 8f73ff0c3707e5b3f27f54f2b94e03ccb193d698 (diff) | |
download | CMake-8c60c49ae2ac24915931708435f632e66b713f4b.zip CMake-8c60c49ae2ac24915931708435f632e66b713f4b.tar.gz CMake-8c60c49ae2ac24915931708435f632e66b713f4b.tar.bz2 |
Xcode: Refactor custom command dependency expansion
Compute and store the "real" dependencies earlier.
Diffstat (limited to 'Source/cmGlobalXCodeGenerator.cxx')
-rw-r--r-- | Source/cmGlobalXCodeGenerator.cxx | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index 9f8e331..c6edfad 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -1839,6 +1839,15 @@ void cmGlobalXCodeGenerator::CreateCustomRulesMakefile( for (auto const& command : commands) { cmCustomCommandGenerator ccg(command, configName, this->CurrentLocalGenerator); + std::vector<std::string> realDepends; + realDepends.reserve(ccg.GetDepends().size()); + for (auto const& d : ccg.GetDepends()) { + std::string dep; + if (this->CurrentLocalGenerator->GetRealDependency(d, configName, dep)) { + realDepends.emplace_back(std::move(dep)); + } + } + if (ccg.GetNumberOfCommands() > 0) { makefileStream << "\n"; const std::vector<std::string>& outputs = ccg.GetOutputs(); @@ -1854,12 +1863,8 @@ void cmGlobalXCodeGenerator::CreateCustomRulesMakefile( // There are no outputs. Use the generated force rule name. makefileStream << tname[&ccg.GetCC()] << ": "; } - for (auto const& d : ccg.GetDepends()) { - std::string dep; - if (this->CurrentLocalGenerator->GetRealDependency(d, configName, - dep)) { - makefileStream << "\\\n" << this->ConvertToRelativeForMake(dep); - } + for (auto const& dep : realDepends) { + makefileStream << "\\\n" << this->ConvertToRelativeForMake(dep); } makefileStream << "\n"; |