Skip to content

Commit

Permalink
Added support for setting git version externally
Browse files Browse the repository at this point in the history
* This to help when building from source snapshots
  that typically don't have an entire repository.
  • Loading branch information
G-M0N3Y-2503 committed Nov 1, 2020
1 parent de40ad0 commit f85ae9d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,20 @@ execute_process(
OUTPUT_VARIABLE git_dirty_check_out
)

if("${git_version_check_ret}" EQUAL 0)
set(tini_VERSION_GIT " - git.${tini_VERSION_GIT}")
if(NOT "${TINI_COMMIT}" STREQUAL "")
set(tini_VERSION_GIT "${TINI_COMMIT}")
elseif("${git_version_check_ret}" EQUAL 0)
if(NOT "${git_dirty_check_out}" STREQUAL "")
set(tini_VERSION_GIT "${tini_VERSION_GIT}-dirty")
endif()
else()
set(tini_VERSION_GIT "")
endif()

if(NOT ${tini_VERSION_GIT} STREQUAL "")
set(tini_VERSION_GIT " - git.${tini_VERSION_GIT}")
endif()

# Flags
include(CheckCSourceCompiles)

Expand Down

0 comments on commit f85ae9d

Please sign in to comment.