mirror of
https://gitlab.kitware.com/cmake/cmake.git
synced 2026-10-04 04:03:22 +03: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:
1 parent
625b8f9076
commit
ee44f390ce
1 file changed
+5
-3
@@ -931,12 +931,14 @@ void cmGlobalNinjaGenerator::AddDependencyToAll(const std::string& input)
|
|||||||
void cmGlobalNinjaGenerator::WriteAssumedSourceDependencies()
|
void cmGlobalNinjaGenerator::WriteAssumedSourceDependencies()
|
||||||
{
|
{
|
||||||
for (auto const& asd : this->AssumedSourceDependencies) {
|
for (auto const& asd : this->AssumedSourceDependencies) {
|
||||||
cmNinjaDeps deps;
|
cmNinjaDeps orderOnlyDeps;
|
||||||
std::copy(asd.second.begin(), asd.second.end(), std::back_inserter(deps));
|
std::copy(asd.second.begin(), asd.second.end(),
|
||||||
|
std::back_inserter(orderOnlyDeps));
|
||||||
WriteCustomCommandBuild(/*command=*/"", /*description=*/"",
|
WriteCustomCommandBuild(/*command=*/"", /*description=*/"",
|
||||||
"Assume dependencies for generated source file.",
|
"Assume dependencies for generated source file.",
|
||||||
/*depfile*/ "", /*uses_terminal*/ false,
|
/*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