[Cmake-commits] CMake branch, master, updated. v3.11.1-633-g6fd60c6
Kitware Robot
kwrobot at kitware.com
Thu Apr 26 08:55:03 EDT 2018
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".
The branch, master has been updated
via 6fd60c6ef0053406b4a88fc2b79c00f49c5bac7a (commit)
via cca8bc88ba245ed670ae1ec9ebf043a320b42763 (commit)
via a92ee4e30d57ef957a7a2ff4e0d5066136a2f6c2 (commit)
via ee44f390ceaadee1517043dfb5f21fce147e740e (commit)
via 625b8f9076080b3831ef7821812461b694ef5586 (commit)
via ae6722483e8e1b64cf05d5186c6240d724ad409e (commit)
via 0826c20128fad20aafac2006ac0371e381e3cf60 (commit)
from 5858267df6a1538ae0af8d503cd7f20b69c3f503 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6fd60c6ef0053406b4a88fc2b79c00f49c5bac7a
commit 6fd60c6ef0053406b4a88fc2b79c00f49c5bac7a
Merge: cca8bc8 a92ee4e
Author: Brad King <brad.king at kitware.com>
AuthorDate: Thu Apr 26 08:50:33 2018 -0400
Commit: Brad King <brad.king at kitware.com>
CommitDate: Thu Apr 26 08:50:33 2018 -0400
Merge branch 'release-3.11'
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=cca8bc88ba245ed670ae1ec9ebf043a320b42763
commit cca8bc88ba245ed670ae1ec9ebf043a320b42763
Merge: 5858267 ee44f39
Author: Brad King <brad.king at kitware.com>
AuthorDate: Thu Apr 26 12:45:31 2018 +0000
Commit: Kitware Robot <kwrobot at kitware.com>
CommitDate: Thu Apr 26 08:48:45 2018 -0400
Merge topic 'ninja-issue-17942'
ee44f390ce Ninja: Make assumed source dependencies order-only
625b8f9076 Ninja: Avoid empty phony edges for target ordering
ae6722483e Merge branch 'backport-ninja-issue-17942' into ninja-issue-17942
0826c20128 Ninja: Do not add empty custom command for file(GENERATE) outputs
Acked-by: Kitware Robot <kwrobot at kitware.com>
Merge-request: !2010
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ee44f390ceaadee1517043dfb5f21fce147e740e
commit ee44f390ceaadee1517043dfb5f21fce147e740e
Author: Brad King <brad.king at kitware.com>
AuthorDate: Wed Apr 25 12:57:03 2018 -0400
Commit: Brad King <brad.king at kitware.com>
CommitDate: Thu Apr 26 08:40:59 2018 -0400
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
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);
}
}
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=625b8f9076080b3831ef7821812461b694ef5586
commit 625b8f9076080b3831ef7821812461b694ef5586
Author: Brad King <brad.king at kitware.com>
AuthorDate: Wed Apr 25 11:33:53 2018 -0400
Commit: Brad King <brad.king at kitware.com>
CommitDate: Thu Apr 26 08:40:57 2018 -0400
Ninja: Avoid empty phony edges for target ordering
Since commit v3.9.0-rc1~230^2~2 (ninja: break unnecessary target
dependencies, 2017-04-17) we unconditionally generate a phony edge for
target ordering. It is needed in case a later target depends on it.
However, if the phony edge has no inputs then `ninja -d explain` prints:
ninja explain: output ... of phony edge with no inputs doesn't exist
Furthermore the phony edge's output is considered dirty and can cause
dependents to be incorrectly considered dirty. Avoid this by always
generating at least one input to the target ordering phony edges.
If we have no real dependencies just use a path that always exists.
Fixes: #17942
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index 4ce3cef..7dfce57 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -821,6 +821,19 @@ void cmNinjaTargetGenerator::WriteObjectBuildStatements()
orderOnlyDeps.erase(std::unique(orderOnlyDeps.begin(), orderOnlyDeps.end()),
orderOnlyDeps.end());
+ // The phony target must depend on at least one input or ninja will explain
+ // that "output ... of phony edge with no inputs doesn't exist" and consider
+ // the phony output "dirty".
+ if (orderOnlyDeps.empty()) {
+ // Any path that always exists will work here. It would be nice to
+ // use just "." but that is not supported by Ninja < 1.7.
+ std::string tgtDir;
+ tgtDir += this->LocalGenerator->GetCurrentBinaryDirectory();
+ tgtDir += "/";
+ tgtDir += this->LocalGenerator->GetTargetDirectory(this->GeneratorTarget);
+ orderOnlyDeps.push_back(this->ConvertToNinjaPath(tgtDir));
+ }
+
{
cmNinjaDeps orderOnlyTarget;
orderOnlyTarget.push_back(this->OrderDependsTargetForTarget());
diff --git a/Tests/RunCMake/Ninja/NoWorkToDo-nowork-stdout.txt b/Tests/RunCMake/Ninja/NoWorkToDo-nowork-stdout.txt
new file mode 100644
index 0000000..60a9228
--- /dev/null
+++ b/Tests/RunCMake/Ninja/NoWorkToDo-nowork-stdout.txt
@@ -0,0 +1 @@
+^ninja: no work to do
diff --git a/Tests/RunCMake/Ninja/NoWorkToDo.cmake b/Tests/RunCMake/Ninja/NoWorkToDo.cmake
new file mode 100644
index 0000000..a2fa0cb
--- /dev/null
+++ b/Tests/RunCMake/Ninja/NoWorkToDo.cmake
@@ -0,0 +1,2 @@
+enable_language(C)
+add_executable(hello hello.c)
diff --git a/Tests/RunCMake/Ninja/RunCMakeTest.cmake b/Tests/RunCMake/Ninja/RunCMakeTest.cmake
index 3bb2b6b..b6e6cd4 100644
--- a/Tests/RunCMake/Ninja/RunCMakeTest.cmake
+++ b/Tests/RunCMake/Ninja/RunCMakeTest.cmake
@@ -21,6 +21,15 @@ function(run_NinjaToolMissing)
endfunction()
run_NinjaToolMissing()
+function(run_NoWorkToDo)
+ run_cmake(NoWorkToDo)
+ set(RunCMake_TEST_NO_CLEAN 1)
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/NoWorkToDo-build)
+ run_cmake_command(NoWorkToDo-build ${CMAKE_COMMAND} --build .)
+ run_cmake_command(NoWorkToDo-nowork ${CMAKE_COMMAND} --build . -- -d explain)
+endfunction()
+run_NoWorkToDo()
+
function(run_CMP0058 case)
# Use a single build tree for a few tests without cleaning.
set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/CMP0058-${case}-build)
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ae6722483e8e1b64cf05d5186c6240d724ad409e
commit ae6722483e8e1b64cf05d5186c6240d724ad409e
Merge: 83e3b14 0826c20
Author: Brad King <brad.king at kitware.com>
AuthorDate: Thu Apr 26 08:40:49 2018 -0400
Commit: Brad King <brad.king at kitware.com>
CommitDate: Thu Apr 26 08:40:49 2018 -0400
Merge branch 'backport-ninja-issue-17942' into ninja-issue-17942
-----------------------------------------------------------------------
Summary of changes:
Source/cmGeneratorExpressionEvaluationFile.cxx | 6 ++++++
Source/cmGlobalNinjaGenerator.cxx | 8 +++++---
Source/cmNinjaTargetGenerator.cxx | 17 ++++++++++++++++-
Tests/RunCMake/Ninja/NoWorkToDo-nowork-stdout.txt | 1 +
Tests/RunCMake/Ninja/NoWorkToDo.cmake | 2 ++
Tests/RunCMake/Ninja/RunCMakeTest.cmake | 9 +++++++++
6 files changed, 39 insertions(+), 4 deletions(-)
create mode 100644 Tests/RunCMake/Ninja/NoWorkToDo-nowork-stdout.txt
create mode 100644 Tests/RunCMake/Ninja/NoWorkToDo.cmake
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list