File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -99,15 +99,19 @@ if(ANDROID)
9999endif ()
100100
101101if (NOT DEFINED BUILD_ID)
102- if (IS_DIRECTORY ${CMAKE_SOURCE_DIR} /.git)
102+ find_program (GIT_EXECUTABLE git)
103+ if (IS_DIRECTORY ${CMAKE_SOURCE_DIR} /.git AND GIT_EXECUTABLE)
103104 execute_process (
104105 OUTPUT_VARIABLE BUILD_ID
105106 OUTPUT_STRIP_TRAILING_WHITESPACE
106- COMMAND git -C ${CMAKE_SOURCE_DIR} log -1 --format=%cd --date=format:${PROJECT_VERSION_MAJOR} .%Y%m%d%H%M HEAD
107+ COMMAND ${GIT_EXECUTABLE} -C ${CMAKE_SOURCE_DIR} log -1 --format=%cd --date=format:${PROJECT_VERSION_MAJOR} .%Y%m%d%H%M HEAD
107108 )
108109 else ()
109110 string (TIMESTAMP BUILD_ID ${PROJECT_VERSION_MAJOR} .%Y%m%d%H%M)
110111 endif ()
112+ if (NOT BUILD_ID)
113+ message (FATAL_ERROR "BUILD_ID could not be generated and is empty." )
114+ endif ()
111115 message ("Generated BUILD_ID: ${BUILD_ID} " )
112116endif ()
113117
You can’t perform that action at this time.
0 commit comments