#709 handle the case when git fail to get last commit id (#723)

This commit is contained in:
Cai Yudong 2019-12-07 17:00:21 +08:00 committed by Jin Hai
parent f831f3cf3b
commit c11a4c594e

View File

@ -69,10 +69,11 @@ GET_LAST_COMMIT_ID(LAST_COMMIT_ID)
message(STATUS "LAST_COMMIT_ID = ${LAST_COMMIT_ID}")
if (NOT LAST_COMMIT_ID STREQUAL "")
string(REGEX REPLACE "\n" "" LAST_COMMIT_ID ${LAST_COMMIT_ID})
set(LAST_COMMIT_ID "${LAST_COMMIT_ID}")
else ()
set(LAST_COMMIT_ID "Unknown")
endif ()
set(LAST_COMMIT_ID "${LAST_COMMIT_ID}")
# set build type
if (CMAKE_BUILD_TYPE STREQUAL "Release")
set(BUILD_TYPE "Release")