remove fatal error message from git revision when not in git

This commit is contained in:
Jeff Becker 2019-05-03 10:00:12 -04:00
parent 0cc8517bca
commit 3e0585e0b8
No known key found for this signature in database
GPG Key ID: F357B3B42F6F9B05
1 changed files with 3 additions and 1 deletions

View File

@ -189,9 +189,11 @@ add_compile_options(${OPTIMIZE_FLAGS} ${CRYPTO_FLAGS})
if(NOT GIT_VERSION)
exec_program("git" ${CMAKE_CURRENT_SOURCE_DIR} ARGS "rev-parse --short HEAD" OUTPUT_VARIABLE GIT_VERSION_UNSTRIP)
string(STRIP "${GIT_VERSION_UNSTRIP}" GIT_VERSION)
add_definitions("-DGIT_REV=\"${GIT_VERSION}\"")
endif(NOT GIT_VERSION)
string(REGEX REPLACE ^fatal.*$ nogit GIT_VERSION_REAL "${GIT_VERSION}")
add_definitions("-DGIT_REV=\"${GIT_VERSION_REAL}\"")
set(EXE lokinet)
set(EXE_SRC daemon/main.cpp)