Skip to content

Commit

Permalink
fix nncase version suffix. (#1099)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangyang2057 authored Sep 22, 2023
1 parent a6c39af commit e76b478
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,23 @@ endif()

if(NOT DEFINED NNCASE_VERSION_SUFFIX)
find_package (Git)

execute_process(
COMMAND ${GIT_EXECUTABLE} describe --always --dirty
COMMAND ${GIT_EXECUTABLE} describe --always --dirty --tag
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE GIT_DESC
OUTPUT_VARIABLE GIT_TAG
OUTPUT_STRIP_TRAILING_WHITESPACE)
set(NNCASE_VERSION_SUFFIX "-${GIT_DESC}")

if ("v${NNCASE_VERSION}" STREQUAL ${GIT_TAG})
set(NNCASE_VERSION_SUFFIX "")
else()
execute_process(
COMMAND ${GIT_EXECUTABLE} describe --always --dirty
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE GIT_DESC
OUTPUT_STRIP_TRAILING_WHITESPACE)
set(NNCASE_VERSION_SUFFIX "-${GIT_DESC}")
endif()
endif()

if (NOT PACKAGE_VERSION)
Expand Down

0 comments on commit e76b478

Please sign in to comment.