build: use lightweight tags too as version

As autogenerated by github releases
This commit is contained in:
bnnm 2021-08-15 16:32:53 +02:00
parent 265391ca03
commit bad14dc89d
3 changed files with 6 additions and 6 deletions

View File

@ -2,12 +2,12 @@
# echo current git version (doesn't make version_auto.h)
# test if git exists
# try get version from Git (dynamic), including lightweight tags
if ! command -v git > /dev/null
then
VERSION="unknown"
else
VERSION=$(git describe --always 2>&1 | tr : _ )
VERSION=$(git describe --tags --always 2>&1 | tr : _ )
fi
# ignore git stderr "fatal:

View File

@ -16,9 +16,9 @@ if not "%VERSION%"=="" set VERSION=!VERSION:^:=_!
cd /d "%~dp0"
REM try get version from Git (dynamic)
REM try get version from Git (dynamic), including lightweight tags
:get_version_git
for /f %%v in ('git describe --always') do set VERSION=%%v
for /f %%v in ('git describe --tags --always') do set VERSION=%%v
if not "%VERSION%"=="" set VERSION=!VERSION:^:=_!
if "%VERSION%"=="" goto :get_version_h
if %VERSION%==%VERSION_DEFAULT% goto :get_version_h

View File

@ -6,11 +6,11 @@ VERSION_NAME=VGMSTREAM_VERSION
VERSION_FILE=version_auto.h
# try get version from Git (dynamic)
# try get version from Git (dynamic), including lightweight tags
if ! command -v git > /dev/null ; then
VERSION=""
else
VERSION=$(git describe --always 2>&1 | tr : _ )
VERSION=$(git describe --tags --always 2>&1 | tr : _ )
fi