mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-05 05:11:15 -06:00
Ninja: Simplify generation of custom target logical path
In `AppendTargetOutputs` we generate a logical build target name for each UTILITY command. Simplify the logic to avoid testing the result of `ConvertToNinjaPath`.
This commit is contained in:
@@ -836,15 +836,10 @@ void cmGlobalNinjaGenerator::AppendTargetOutputs(
|
|||||||
}
|
}
|
||||||
case cmState::OBJECT_LIBRARY:
|
case cmState::OBJECT_LIBRARY:
|
||||||
case cmState::UTILITY: {
|
case cmState::UTILITY: {
|
||||||
std::string path = this->ConvertToNinjaPath(
|
std::string path =
|
||||||
target->GetLocalGenerator()->GetCurrentBinaryDirectory());
|
target->GetLocalGenerator()->GetCurrentBinaryDirectory() +
|
||||||
if (path.empty() || path == ".")
|
std::string("/") + target->GetName();
|
||||||
outputs.push_back(target->GetName());
|
outputs.push_back(this->ConvertToNinjaPath(path));
|
||||||
else {
|
|
||||||
path += "/";
|
|
||||||
path += target->GetName();
|
|
||||||
outputs.push_back(path);
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user