mirror of
https://github.com/Kitware/CMake.git
synced 2025-10-20 04:24:36 +08:00
Xcode: Refactor custom command dependency expansion
Compute and store the "real" dependencies earlier.
This commit is contained in:
@@ -1839,6 +1839,15 @@ void cmGlobalXCodeGenerator::CreateCustomRulesMakefile(
|
|||||||
for (auto const& command : commands) {
|
for (auto const& command : commands) {
|
||||||
cmCustomCommandGenerator ccg(command, configName,
|
cmCustomCommandGenerator ccg(command, configName,
|
||||||
this->CurrentLocalGenerator);
|
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) {
|
if (ccg.GetNumberOfCommands() > 0) {
|
||||||
makefileStream << "\n";
|
makefileStream << "\n";
|
||||||
const std::vector<std::string>& outputs = ccg.GetOutputs();
|
const std::vector<std::string>& outputs = ccg.GetOutputs();
|
||||||
@@ -1854,13 +1863,9 @@ void cmGlobalXCodeGenerator::CreateCustomRulesMakefile(
|
|||||||
// There are no outputs. Use the generated force rule name.
|
// There are no outputs. Use the generated force rule name.
|
||||||
makefileStream << tname[&ccg.GetCC()] << ": ";
|
makefileStream << tname[&ccg.GetCC()] << ": ";
|
||||||
}
|
}
|
||||||
for (auto const& d : ccg.GetDepends()) {
|
for (auto const& dep : realDepends) {
|
||||||
std::string dep;
|
|
||||||
if (this->CurrentLocalGenerator->GetRealDependency(d, configName,
|
|
||||||
dep)) {
|
|
||||||
makefileStream << "\\\n" << this->ConvertToRelativeForMake(dep);
|
makefileStream << "\\\n" << this->ConvertToRelativeForMake(dep);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
makefileStream << "\n";
|
makefileStream << "\n";
|
||||||
|
|
||||||
if (const char* comment = ccg.GetComment()) {
|
if (const char* comment = ccg.GetComment()) {
|
||||||
|
Reference in New Issue
Block a user