Skip to content

Commit

Permalink
build: check git describe return code
Browse files Browse the repository at this point in the history
  • Loading branch information
bamiaux committed Apr 9, 2018
1 parent 13d3522 commit f54ff68
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions build/common.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -219,10 +219,14 @@ function(setup_git target files_ includes_)
# generate compile-time git version configuration
file(WRITE ${root}/git_version.cmake "
execute_process(COMMAND
${GIT_EXECUTABLE} describe --dirty --tags --long
WORKING_DIRECTORY \"${root_dir}\"
OUTPUT_VARIABLE GIT_VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE)
${GIT_EXECUTABLE} describe --dirty --tags --long
WORKING_DIRECTORY \"${root_dir}\"
OUTPUT_VARIABLE GIT_VERSION
RESULT_VARIABLE retcode
OUTPUT_STRIP_TRAILING_WHITESPACE)
if(NOT \"$\{retcode}\" STREQUAL \"0\")
message(FATAL_ERROR \"${GIT_EXECUTABLE} describe --dirty --tags --long: returned $\{retcode}\")
endif()
configure_file(\"\${SRC}\" \"\${DST}\" @ONLY)
")

Expand Down

0 comments on commit f54ff68

Please sign in to comment.