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, next has been updated via e8f8a0805ff5cf70cd962c8365dcff47797cb45d (commit) via 3477b26ff6c455b64421bf19000d7203acdd6024 (commit) via 7d64a0598db5da2c4c1874f9fe8726fd6c9b18a7 (commit) via 866c75dedd42fae9dd05be402bdc94d51ffc7713 (commit) from 8cebadd7215fb67b9e2f73e341d8a04520840a04 (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=e8f8a0805ff5cf70cd962c8365dcff47797cb45d commit e8f8a0805ff5cf70cd962c8365dcff47797cb45d Merge: 8cebadd 3477b26 Author: Brad King <brad.k...@kitware.com> AuthorDate: Thu Nov 19 15:49:24 2015 -0500 Commit: CMake Topic Stage <kwro...@kitware.com> CommitDate: Thu Nov 19 15:49:24 2015 -0500 Merge topic 'ninja-symbolic-custom-command' into next 3477b26f Ninja: Always re-run custom commands that have symbolic dependencies 7d64a059 Ninja: Add 'restat' parameter to custom command generation method 866c75de Ninja: Refactor generation of 'restat' on custom commands https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3477b26ff6c455b64421bf19000d7203acdd6024 commit 3477b26ff6c455b64421bf19000d7203acdd6024 Author: Brad King <brad.k...@kitware.com> AuthorDate: Thu Nov 19 15:13:11 2015 -0500 Commit: Brad King <brad.k...@kitware.com> CommitDate: Thu Nov 19 15:47:41 2015 -0500 Ninja: Always re-run custom commands that have symbolic dependencies If a custom command has a SYMBOLIC output (that is never actually created) then do not mark the custom command build statement as 'restat'. Otherwise other custom commands that depend on the symbolic output may not always re-run because after running the first custom command Ninja 'restat' will detect that the output timestamp did not change and skip its dependents. This was observed with the ExternalProject BUILD_ALWAYS option where Ninja would not re-run the 'install' step each time 'build' re-runs. diff --git a/Source/cmLocalNinjaGenerator.cxx b/Source/cmLocalNinjaGenerator.cxx index d9517d8..b2927a9 100644 --- a/Source/cmLocalNinjaGenerator.cxx +++ b/Source/cmLocalNinjaGenerator.cxx @@ -398,6 +398,16 @@ cmLocalNinjaGenerator::WriteCustomCommandBuildStatement( const std::vector<std::string> &byproducts = ccg.GetByproducts(); cmNinjaDeps ninjaOutputs(outputs.size()+byproducts.size()), ninjaDeps; + bool symbolic = false; + for (std::vector<std::string>::const_iterator o = outputs.begin(); + o != outputs.end(); ++o) + { + if (cmSourceFile* sf = this->Makefile->GetSource(*o)) + { + symbolic = sf->GetPropertyAsBool("SYMBOLIC"); + } + } + #if 0 #error TODO: Once CC in an ExternalProject target must provide the \ file of each imported target that has an add_dependencies pointing \ @@ -434,7 +444,7 @@ cmLocalNinjaGenerator::WriteCustomCommandBuildStatement( this->ConstructComment(ccg), "Custom command for " + ninjaOutputs[0], cc->GetUsesTerminal(), - /*restat*/true, + /*restat*/!symbolic, ninjaOutputs, ninjaDeps, orderOnlyDeps); diff --git a/Tests/RunCMake/BuildDepends/Custom-Always.cmake b/Tests/RunCMake/BuildDepends/Custom-Always.cmake new file mode 100644 index 0000000..d412708 --- /dev/null +++ b/Tests/RunCMake/BuildDepends/Custom-Always.cmake @@ -0,0 +1,24 @@ +add_custom_command( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/before-always + COMMAND ${CMAKE_COMMAND} -E touch before-always + ) +add_custom_command( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/always + COMMAND ${CMAKE_COMMAND} -E touch always-updated + DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/before-always + ) +set_property(SOURCE always PROPERTY SYMBOLIC 1) +add_custom_command( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/after-always + DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/always + COMMAND ${CMAKE_COMMAND} -E touch after-always + ) + +add_custom_target(drive ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/after-always) + +file(GENERATE OUTPUT check-$<LOWER_CASE:$<CONFIG>>.cmake CONTENT " +set(check_pairs + \"${CMAKE_CURRENT_BINARY_DIR}/always-updated|${CMAKE_CURRENT_BINARY_DIR}/before-always\" + \"${CMAKE_CURRENT_BINARY_DIR}/after-always|${CMAKE_CURRENT_BINARY_DIR}/always-updated\" + ) +") diff --git a/Tests/RunCMake/BuildDepends/RunCMakeTest.cmake b/Tests/RunCMake/BuildDepends/RunCMakeTest.cmake index a578408..31c72fb 100644 --- a/Tests/RunCMake/BuildDepends/RunCMakeTest.cmake +++ b/Tests/RunCMake/BuildDepends/RunCMakeTest.cmake @@ -38,3 +38,5 @@ if(NOT RunCMake_GENERATOR MATCHES "Visual Studio [67]|Xcode") run_BuildDepends(C-Exe-Manifest) unset(run_BuildDepends_skip_step_2) endif() + +run_BuildDepends(Custom-Always) https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7d64a0598db5da2c4c1874f9fe8726fd6c9b18a7 commit 7d64a0598db5da2c4c1874f9fe8726fd6c9b18a7 Author: Brad King <brad.k...@kitware.com> AuthorDate: Thu Nov 19 15:09:40 2015 -0500 Commit: Brad King <brad.k...@kitware.com> CommitDate: Thu Nov 19 15:11:00 2015 -0500 Ninja: Add 'restat' parameter to custom command generation method Pass 'true' from all call sites to preserve existing behavior. diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx index 64c2625..0f06e43 100644 --- a/Source/cmGlobalNinjaGenerator.cxx +++ b/Source/cmGlobalNinjaGenerator.cxx @@ -284,6 +284,7 @@ cmGlobalNinjaGenerator::WriteCustomCommandBuild(const std::string& command, const std::string& description, const std::string& comment, bool uses_terminal, + bool restat, const cmNinjaDeps& outputs, const cmNinjaDeps& deps, const cmNinjaDeps& orderOnly) @@ -300,7 +301,10 @@ cmGlobalNinjaGenerator::WriteCustomCommandBuild(const std::string& command, cmNinjaVars vars; vars["COMMAND"] = cmd; vars["DESC"] = EncodeLiteral(description); - vars["restat"] = "1"; + if (restat) + { + vars["restat"] = "1"; + } if (uses_terminal && SupportsConsolePool()) { vars["pool"] = "console"; @@ -924,6 +928,7 @@ void cmGlobalNinjaGenerator::WriteAssumedSourceDependencies() WriteCustomCommandBuild(/*command=*/"", /*description=*/"", "Assume dependencies for generated source file.", /*uses_terminal*/false, + /*restat*/true, cmNinjaDeps(1, i->first), deps); } } diff --git a/Source/cmGlobalNinjaGenerator.h b/Source/cmGlobalNinjaGenerator.h index c494d36..8656590 100644 --- a/Source/cmGlobalNinjaGenerator.h +++ b/Source/cmGlobalNinjaGenerator.h @@ -112,6 +112,7 @@ public: const std::string& description, const std::string& comment, bool uses_terminal, + bool restat, const cmNinjaDeps& outputs, const cmNinjaDeps& deps = cmNinjaDeps(), const cmNinjaDeps& orderOnly = cmNinjaDeps()); diff --git a/Source/cmLocalNinjaGenerator.cxx b/Source/cmLocalNinjaGenerator.cxx index ecaa269..d9517d8 100644 --- a/Source/cmLocalNinjaGenerator.cxx +++ b/Source/cmLocalNinjaGenerator.cxx @@ -434,6 +434,7 @@ cmLocalNinjaGenerator::WriteCustomCommandBuildStatement( this->ConstructComment(ccg), "Custom command for " + ninjaOutputs[0], cc->GetUsesTerminal(), + /*restat*/true, ninjaOutputs, ninjaDeps, orderOnlyDeps); diff --git a/Source/cmNinjaUtilityTargetGenerator.cxx b/Source/cmNinjaUtilityTargetGenerator.cxx index edc65f0..ac66fcd 100644 --- a/Source/cmNinjaUtilityTargetGenerator.cxx +++ b/Source/cmNinjaUtilityTargetGenerator.cxx @@ -131,6 +131,7 @@ void cmNinjaUtilityTargetGenerator::Generate() desc, "Utility command for " + this->GetTargetName(), uses_terminal, + /*restat*/true, util_outputs, deps); https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=866c75dedd42fae9dd05be402bdc94d51ffc7713 commit 866c75dedd42fae9dd05be402bdc94d51ffc7713 Author: Brad King <brad.k...@kitware.com> AuthorDate: Thu Nov 19 14:47:36 2015 -0500 Commit: Brad King <brad.k...@kitware.com> CommitDate: Thu Nov 19 14:51:24 2015 -0500 Ninja: Refactor generation of 'restat' on custom commands Move generation of 'restat = 1' from the CUSTOM_COMMAND rule to every build statement using it. This will allow future selection of this option on a per-custom-command basis. diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx index a8a307c..64c2625 100644 --- a/Source/cmGlobalNinjaGenerator.cxx +++ b/Source/cmGlobalNinjaGenerator.cxx @@ -275,7 +275,7 @@ void cmGlobalNinjaGenerator::AddCustomCommandRule() /*deptype*/ "", /*rspfile*/ "", /*rspcontent*/ "", - /*restat*/ "1", + /*restat*/ "", // bound on each build statement as needed /*generator*/ false); } @@ -300,6 +300,7 @@ cmGlobalNinjaGenerator::WriteCustomCommandBuild(const std::string& command, cmNinjaVars vars; vars["COMMAND"] = cmd; vars["DESC"] = EncodeLiteral(description); + vars["restat"] = "1"; if (uses_terminal && SupportsConsolePool()) { vars["pool"] = "console"; ----------------------------------------------------------------------- Summary of changes: Source/cmGlobalNinjaGenerator.cxx | 8 +++++++- Source/cmGlobalNinjaGenerator.h | 1 + Source/cmLocalNinjaGenerator.cxx | 11 +++++++++++ Source/cmNinjaUtilityTargetGenerator.cxx | 1 + Tests/RunCMake/BuildDepends/Custom-Always.cmake | 24 +++++++++++++++++++++++ Tests/RunCMake/BuildDepends/RunCMakeTest.cmake | 2 ++ 6 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 Tests/RunCMake/BuildDepends/Custom-Always.cmake hooks/post-receive -- CMake _______________________________________________ Cmake-commits mailing list Cmake-commits@cmake.org http://public.kitware.com/mailman/listinfo/cmake-commits