GIT_TAP=$R2_VERSION if no .git is found ##build

This commit is contained in:
pancake 2022-08-01 15:57:50 +02:00 committed by GitHub
parent a86c2a1aaa
commit 34323f2c30
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 0 deletions

View File

@ -59,6 +59,12 @@ all: plugins.cfg libr/include/r_version.h
GIT_TAP=$(shell git describe --tags --match '[0-9]*' 2>/dev/null)
GIT_TIP=$(shell git rev-parse HEAD 2>/dev/null || echo $(R2_VERSION))
R2_VER=$(shell ./configure -qV)
ifeq ($(GIT_TAP),)
GIT_TAP=$(R2_VER)
endif
ifeq ($(GIT_TIP),)
GIT_TIP=$(R2_VER)
endif
ifdef SOURCE_DATE_EPOCH
GIT_NOW=$(shell date -u -d "@$(SOURCE_DATE_EPOCH)" "+%Y-%m-%d" 2>/dev/null || date -u -r "$(SOURCE_DATE_EPOCH)" "+%Y-%m-%d" 2>/dev/null || date -u "+%Y-%m-%d")
else

View File

@ -37,6 +37,9 @@ if git_exe.found()
if git_rev_list.returncode() == 0
version_commit = git_rev_list.stdout().strip()
endif
if version_commit == ''
version_commit = '0'
endif
# Get gittap
git_describe = run_command(git_exe, '-C', repo, 'describe', '--tags', '--match', '[0-9]*')
@ -68,6 +71,10 @@ if get_option('r2_gittip') != ''
gittip = get_option('r2_gittip')
endif
if gittip == ''
gittip = r2_version
endif
# Get current date
if host_machine.system() == 'windows'
r2birth = run_command('cmd', '/c', 'echo %date%__%time%')