Skip to content

Commit

Permalink
git describe: pass --tags option for compatibility with GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
ericwa committed Jan 23, 2021
1 parent 57865ed commit c34bf90
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cmake/Utils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,9 @@ macro(GET_APP_VERSION GIT_DESCRIBE VERSION_YEAR VERSION_NUMBER)
endmacro(GET_APP_VERSION)

macro(GET_GIT_DESCRIBE GIT SOURCE_DIR GIT_DESCRIBE)
execute_process(COMMAND ${GIT} describe --dirty WORKING_DIRECTORY ${SOURCE_DIR} OUTPUT_VARIABLE ${GIT_DESCRIBE} OUTPUT_STRIP_TRAILING_WHITESPACE)
# When building tags, GitHub Actions checks them out as lightweight tags even if the original tag was annotated.
# Pass --tags to enable git describe to match non-annotated tags.
execute_process(COMMAND ${GIT} describe --dirty --tags WORKING_DIRECTORY ${SOURCE_DIR} OUTPUT_VARIABLE ${GIT_DESCRIBE} OUTPUT_STRIP_TRAILING_WHITESPACE)
endmacro(GET_GIT_DESCRIBE)

macro(GET_BUILD_PLATFORM PLATFORM_NAME)
Expand Down

0 comments on commit c34bf90

Please sign in to comment.