[Cmake-commits] CMake branch, next, updated. v3.6.0-rc1-163-ge0e77e6

Brad King brad.king at kitware.com
Thu Jun 9 09:15:13 EDT 2016


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  e0e77e695ed98884f93ed81679c9ade5802ac5a8 (commit)
       via  0bd91ad4058c006bb67b48801e1877e8a893ef4d (commit)
      from  85dca2c756691ae8f954f6e4d4d002655ebdd206 (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=e0e77e695ed98884f93ed81679c9ade5802ac5a8
commit e0e77e695ed98884f93ed81679c9ade5802ac5a8
Merge: 85dca2c 0bd91ad
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Thu Jun 9 09:15:12 2016 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Thu Jun 9 09:15:12 2016 -0400

    Merge topic 'java-export-targets' into next
    
    0bd91ad4 UseJava: Fix race condition creating java class list


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0bd91ad4058c006bb67b48801e1877e8a893ef4d
commit 0bd91ad4058c006bb67b48801e1877e8a893ef4d
Author:     Matthew Woehlke <matthew.woehlke at kitware.com>
AuthorDate: Wed Jun 8 13:48:30 2016 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Thu Jun 9 09:12:15 2016 -0400

    UseJava: Fix race condition creating java class list
    
    Modify logic to unconditionally create an empty class list response file
    to instead only create the empty file if no classes are being compiled.
    Otherwise, the response file is created via a custom command that
    generates the correct list.
    
    This fixes a race condition on certain systems (e.g. HFS on OS X) where
    the dependency for creating the "correct" list can have the "same" (due
    to limited precision of the filesystem) timestamp as the empty file
    created at configure time, resulting in an empty class list being
    incorrectly used to invoke `jar` (resulting in `jar` being unhappy that
    it was not given any input files). Although one would have some hope
    that this doesn't affect "real" projects, it definitely does affect the
    JavaExportImport unit test, causing the same to fail randomly when run
    on an HFS partition.

diff --git a/Modules/UseJava.cmake b/Modules/UseJava.cmake
index 6644bd4..cf9c2d7 100644
--- a/Modules/UseJava.cmake
+++ b/Modules/UseJava.cmake
@@ -609,11 +609,6 @@ function(add_jar _TARGET_NAME)
         endif ()
     endforeach()
 
-    # create an empty java_class_filelist
-    if (NOT EXISTS ${CMAKE_JAVA_CLASS_OUTPUT_PATH}/java_class_filelist)
-        file(WRITE ${CMAKE_JAVA_CLASS_OUTPUT_PATH}/java_class_filelist "")
-    endif()
-
     if (_JAVA_COMPILE_FILES OR _JAVA_COMPILE_FILELISTS)
         set (_JAVA_SOURCES_FILELISTS)
 
@@ -653,6 +648,11 @@ function(add_jar _TARGET_NAME)
             DEPENDS ${CMAKE_JAVA_CLASS_OUTPUT_PATH}/java_compiled_${_TARGET_NAME}
             WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
         )
+    else ()
+        # create an empty java_class_filelist
+        if (NOT EXISTS ${CMAKE_JAVA_CLASS_OUTPUT_PATH}/java_class_filelist)
+            file(WRITE ${CMAKE_JAVA_CLASS_OUTPUT_PATH}/java_class_filelist "")
+        endif()
     endif ()
 
     # create the jar file

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

Summary of changes:


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list