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  1fb6c135300184b2c8ea3e8f0785a7aa13334167 (commit)
       via  add7abc8352b87184579401cb2493c72e07aa212 (commit)
       via  ff805113c766371677b97d94cd3092cf6ff0bbf6 (commit)
      from  5ddcbbbcb8d99efd9b9a43e6b20654af4a791c12 (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=1fb6c135300184b2c8ea3e8f0785a7aa13334167
commit 1fb6c135300184b2c8ea3e8f0785a7aa13334167
Merge: 5ddcbbb add7abc
Author:     Brad King <brad.k...@kitware.com>
AuthorDate: Tue Apr 5 16:29:10 2016 -0400
Commit:     CMake Topic Stage <kwro...@kitware.com>
CommitDate: Tue Apr 5 16:29:10 2016 -0400

    Merge topic 'ninja-restat-custom-command-byproducts' into next
    
    add7abc8 Ninja: Restat custom command byproducts even with a SYMBOLIC 
output (#16049)
    ff805113 Ninja: Fix detection of custom command symbolic outputs

diff --cc Tests/RunCMake/BuildDepends/RunCMakeTest.cmake
index 6b2b85a,0dd27d4..8541070
--- a/Tests/RunCMake/BuildDepends/RunCMakeTest.cmake
+++ b/Tests/RunCMake/BuildDepends/RunCMakeTest.cmake
@@@ -39,48 -39,5 +39,49 @@@ if(NOT RunCMake_GENERATOR MATCHES "Visu
    unset(run_BuildDepends_skip_step_2)
  endif()
  
+ run_BuildDepends(Custom-Symbolic-and-Byproduct)
  run_BuildDepends(Custom-Always)
 +
 +if(RunCMake_GENERATOR MATCHES "Make" AND
 +   NOT "${RunCMake_BINARY_DIR}" STREQUAL "${RunCMake_SOURCE_DIR}")
 +  run_BuildDepends(MakeInProjectOnly)
 +endif()
 +
 +function(run_ReGeneration)
 +  # test re-generation of project even if CMakeLists.txt files disappeared
 +
 +  # Use a single build tree for a few tests without cleaning.
 +  set(RunCMake_TEST_BINARY_DIR 
${RunCMake_BINARY_DIR}/regenerate-project-build)
 +  set(RunCMake_TEST_SOURCE_DIR 
${RunCMake_BINARY_DIR}/regenerate-project-source)
 +  set(RunCMake_TEST_NO_CLEAN 1)
 +  file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
 +  file(REMOVE_RECURSE "${RunCMake_TEST_SOURCE_DIR}")
 +  set(ProjectHeader [=[
 +    cmake_minimum_required(VERSION 3.5)
 +    project(Regenerate-Project NONE)
 +  ]=])
 +
 +  # create project with subdirectory
 +  file(WRITE "${RunCMake_TEST_SOURCE_DIR}/CMakeLists.txt" "${ProjectHeader}"
 +    "add_subdirectory(mysubdir)")
 +  file(MAKE_DIRECTORY "${RunCMake_TEST_SOURCE_DIR}/mysubdir")
 +  file(WRITE "${RunCMake_TEST_SOURCE_DIR}/mysubdir/CMakeLists.txt" "# empty")
 +
 +  run_cmake(Regenerate-Project)
 +  execute_process(COMMAND ${CMAKE_COMMAND} -E sleep ${fs_delay})
 +
 +  # now we delete the subdirectory and adjust the CMakeLists.txt
 +  file(REMOVE_RECURSE "${RunCMake_TEST_SOURCE_DIR}/mysubdir")
 +  file(WRITE "${RunCMake_TEST_SOURCE_DIR}/CMakeLists.txt" "${ProjectHeader}")
 +
 +  run_cmake_command(Regenerate-Project-Directory-Removed
 +    ${CMAKE_COMMAND} --build "${RunCMake_TEST_BINARY_DIR}")
 +
 +  unset(RunCMake_TEST_BINARY_DIR)
 +  unset(RunCMake_TEST_SOURCE_DIR)
 +  unset(RunCMake_TEST_NO_CLEAN)
 +endfunction()
 +
 +if(RunCMake_GENERATOR STREQUAL "Xcode")
 +  run_ReGeneration(regenerate-project)
 +endif()

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=add7abc8352b87184579401cb2493c72e07aa212
commit add7abc8352b87184579401cb2493c72e07aa212
Author:     Brad King <brad.k...@kitware.com>
AuthorDate: Tue Apr 5 16:20:28 2016 -0400
Commit:     Brad King <brad.k...@kitware.com>
CommitDate: Tue Apr 5 16:20:28 2016 -0400

    Ninja: Restat custom command byproducts even with a SYMBOLIC output (#16049)
    
    The change in commit v3.5.0-rc1~198^2 (Ninja: Always re-run custom
    commands that have symbolic dependencies, 2015-11-19) broke the
    byproducts feature added by commit v3.2.0-rc1~340^2~2 (Add an option for
    explicit BYPRODUCTS of custom commands, 2014-11-13) when SYMBOLIC
    outputs also appear.  This case occurs with AUTORCC-generated custom
    targets because the output is SYMBOLIC (to always run) and the generated
    file is a byproduct (for restat so dependents do not run unnecessarily).
    
    The two use cases conflict because Ninja does not support per-output
    restat.  Favor restat whenever byproducts are present because it is
    required for byproducts to work correctly.  In use cases where we want
    an always-run chain we simply will not be able to also use byproducts.

diff --git a/Source/cmLocalNinjaGenerator.cxx b/Source/cmLocalNinjaGenerator.cxx
index 6a5949c..2d13507 100644
--- a/Source/cmLocalNinjaGenerator.cxx
+++ b/Source/cmLocalNinjaGenerator.cxx
@@ -444,7 +444,7 @@ cmLocalNinjaGenerator::WriteCustomCommandBuildStatement(
       this->ConstructComment(ccg),
       "Custom command for " + ninjaOutputs[0],
       cc->GetUsesTerminal(),
-      /*restat*/!symbolic,
+      /*restat*/!symbolic || !byproducts.empty(),
       ninjaOutputs,
       ninjaDeps,
       orderOnlyDeps);
diff --git a/Tests/RunCMake/BuildDepends/Custom-Symbolic-and-Byproduct.cmake 
b/Tests/RunCMake/BuildDepends/Custom-Symbolic-and-Byproduct.cmake
new file mode 100644
index 0000000..6948c35
--- /dev/null
+++ b/Tests/RunCMake/BuildDepends/Custom-Symbolic-and-Byproduct.cmake
@@ -0,0 +1,28 @@
+add_custom_command(
+  OUTPUT gen-byproduct gen-byproduct-stamp
+  BYPRODUCTS byproduct
+  COMMAND ${CMAKE_COMMAND} -E touch gen-byproduct-stamp
+  COMMAND ${CMAKE_COMMAND} -E copy_if_different gen-byproduct-stamp byproduct
+  )
+set_property(SOURCE gen-byproduct PROPERTY SYMBOLIC 1)
+add_custom_target(produce DEPENDS gen-byproduct)
+
+add_custom_command(
+  OUTPUT use-byproduct
+  DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/byproduct
+  COMMAND ${CMAKE_COMMAND} -E touch use-byproduct
+  )
+add_custom_target(drive ALL DEPENDS use-byproduct)
+add_dependencies(drive produce)
+
+file(GENERATE OUTPUT check-$<LOWER_CASE:$<CONFIG>>.cmake CONTENT "
+if (check_step EQUAL 1)
+  set(check_pairs
+    
\"${CMAKE_CURRENT_BINARY_DIR}/use-byproduct|${CMAKE_CURRENT_BINARY_DIR}/gen-byproduct-stamp\"
+    )
+else()
+  set(check_pairs
+    
\"${CMAKE_CURRENT_BINARY_DIR}/gen-byproduct-stamp|${CMAKE_CURRENT_BINARY_DIR}/use-byproduct\"
+    )
+endif()
+")
diff --git a/Tests/RunCMake/BuildDepends/RunCMakeTest.cmake 
b/Tests/RunCMake/BuildDepends/RunCMakeTest.cmake
index 31c72fb..0dd27d4 100644
--- a/Tests/RunCMake/BuildDepends/RunCMakeTest.cmake
+++ b/Tests/RunCMake/BuildDepends/RunCMakeTest.cmake
@@ -39,4 +39,5 @@ if(NOT RunCMake_GENERATOR MATCHES "Visual Studio [67]|Xcode")
   unset(run_BuildDepends_skip_step_2)
 endif()
 
+run_BuildDepends(Custom-Symbolic-and-Byproduct)
 run_BuildDepends(Custom-Always)

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ff805113c766371677b97d94cd3092cf6ff0bbf6
commit ff805113c766371677b97d94cd3092cf6ff0bbf6
Author:     Brad King <brad.k...@kitware.com>
AuthorDate: Tue Apr 5 15:31:47 2016 -0400
Commit:     Brad King <brad.k...@kitware.com>
CommitDate: Tue Apr 5 16:19:52 2016 -0400

    Ninja: Fix detection of custom command symbolic outputs
    
    Fix logic introduced by commit v3.5.0-rc1~198^2 (Ninja: Always re-run
    custom commands that have symbolic dependencies, 2015-11-19) to not
    consider only the last output.  We need to know if any output is
    SYMBOLIC, so stop checking as soon as one is found.

diff --git a/Source/cmLocalNinjaGenerator.cxx b/Source/cmLocalNinjaGenerator.cxx
index b2927a9..6a5949c 100644
--- a/Source/cmLocalNinjaGenerator.cxx
+++ b/Source/cmLocalNinjaGenerator.cxx
@@ -400,7 +400,7 @@ cmLocalNinjaGenerator::WriteCustomCommandBuildStatement(
 
   bool symbolic = false;
   for (std::vector<std::string>::const_iterator o = outputs.begin();
-       o != outputs.end(); ++o)
+       !symbolic && o != outputs.end(); ++o)
     {
     if (cmSourceFile* sf = this->Makefile->GetSource(*o))
       {

-----------------------------------------------------------------------

Summary of changes:
 Source/cmLocalNinjaGenerator.cxx                   |    4 +--
 .../Custom-Symbolic-and-Byproduct.cmake            |   28 ++++++++++++++++++++
 Tests/RunCMake/BuildDepends/RunCMakeTest.cmake     |    1 +
 3 files changed, 31 insertions(+), 2 deletions(-)
 create mode 100644 
Tests/RunCMake/BuildDepends/Custom-Symbolic-and-Byproduct.cmake


hooks/post-receive
-- 
CMake
_______________________________________________
Cmake-commits mailing list
Cmake-commits@cmake.org
http://public.kitware.com/mailman/listinfo/cmake-commits

Reply via email to