diff options
author | Brad King <brad.king@kitware.com> | 2018-04-25 16:57:03 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2018-04-26 12:40:59 (GMT) |
commit | ee44f390ceaadee1517043dfb5f21fce147e740e (patch) | |
tree | f94601adf71aa6e8111cdc6b030a30e996b68115 /Source/cmGlobalNinjaGenerator.cxx | |
parent | 625b8f9076080b3831ef7821812461b694ef5586 (diff) | |
download | CMake-ee44f390ceaadee1517043dfb5f21fce147e740e.zip CMake-ee44f390ceaadee1517043dfb5f21fce147e740e.tar.gz CMake-ee44f390ceaadee1517043dfb5f21fce147e740e.tar.bz2 |
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
Diffstat (limited to 'Source/cmGlobalNinjaGenerator.cxx')
-rw-r--r-- | Source/cmGlobalNinjaGenerator.cxx | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx index 2a8576f..c19a61c 100644 --- a/Source/cmGlobalNinjaGenerator.cxx +++ b/Source/cmGlobalNinjaGenerator.cxx @@ -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); } } |