mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-29 18:49:03 -06:00
Ninja: Make assumed source dependencies order-only
Since its beginning the Ninja generator has handled `GENERATED` source files that have no custom command producing them by writing a dummy custom command for them that depends on the target ordering phony edge. Make the custom command's dependency order-only since the phony edge also has only order-only dependencies. The dummy custom command should never be considered "dirty" by `ninja`. Fixes: #17942
This commit is contained in:
@@ -931,12 +931,14 @@ void cmGlobalNinjaGenerator::AddDependencyToAll(const std::string& input)
|
||||
void cmGlobalNinjaGenerator::WriteAssumedSourceDependencies()
|
||||
{
|
||||
for (auto const& asd : this->AssumedSourceDependencies) {
|
||||
cmNinjaDeps deps;
|
||||
std::copy(asd.second.begin(), asd.second.end(), std::back_inserter(deps));
|
||||
cmNinjaDeps orderOnlyDeps;
|
||||
std::copy(asd.second.begin(), asd.second.end(),
|
||||
std::back_inserter(orderOnlyDeps));
|
||||
WriteCustomCommandBuild(/*command=*/"", /*description=*/"",
|
||||
"Assume dependencies for generated source file.",
|
||||
/*depfile*/ "", /*uses_terminal*/ false,
|
||||
/*restat*/ true, cmNinjaDeps(1, asd.first), deps);
|
||||
/*restat*/ true, cmNinjaDeps(1, asd.first),
|
||||
cmNinjaDeps(), orderOnlyDeps);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user