Fix error when getting the commit time fails
authorCampbell Barton <ideasman42@gmail.com>
Sat, 18 Jul 2015 23:51:49 +0000 (09:51 +1000)
committerCampbell Barton <ideasman42@gmail.com>
Sat, 18 Jul 2015 23:51:49 +0000 (09:51 +1000)
While this should work, allow the build to succeed if for some reason the command fails.

build_files/cmake/buildinfo.cmake

index 74c1f8f1f8e2eb218bbcd5ccbf80fbfd77e286ec..756928a8448cbd4ee849195299f41ad6cc88a406 100644 (file)
@@ -97,6 +97,10 @@ if(EXISTS ${SOURCE_DIR}/.git)
                                WORKING_DIRECTORY ${SOURCE_DIR}
                                OUTPUT_VARIABLE MY_WC_COMMIT_TIMESTAMP
                                OUTPUT_STRIP_TRAILING_WHITESPACE)
+               # May fail in rare cases
+               if(MY_WC_COMMIT_TIMESTAMP STREQUAL "")
+                       set(MY_WC_COMMIT_TIMESTAMP 0)
+               endif()
 
                # Update GIT index before getting dirty files
                execute_process(COMMAND git update-index -q --refresh