Fix git hash detection for release builds

This commit is contained in:
Martin Natano
2023-03-25 23:02:32 +01:00
parent 1b24361cf3
commit 870cfde566
2 changed files with 8 additions and 2 deletions
+7 -2
View File
@@ -17,8 +17,13 @@ if(NOT (ret STREQUAL "0"))
"git was not found on your path. If you collect bug reports, please add git to your path and rerun cmake."
)
set(SM_VERSION_GIT_HASH "UNKNOWN")
set(SM_VERSION_GIT
"${SM_VERSION_MAJOR}.${SM_VERSION_MINOR}.${SM_VERSION_PATCH}-${SM_VERSION_GIT_HASH}")
if(WITH_FULL_RELEASE)
set(SM_VERSION_GIT
"${SM_VERSION_MAJOR}.${SM_VERSION_MINOR}.${SM_VERSION_PATCH}")
else()
set(SM_VERSION_GIT
"${SM_VERSION_MAJOR}.${SM_VERSION_MINOR}.${SM_VERSION_PATCH}-${SM_VERSION_GIT_HASH}")
endif()
else()
if(WITH_FULL_RELEASE)
set(SM_VERSION_GIT
+1
View File
@@ -6,6 +6,7 @@ cd "$(dirname $0)"
docker build -f Dockerfile-linux-amd64 . -t itgmania-linux-build:amd64
docker run -i -v $(pwd)/..:/data itgmania-linux-build:amd64 sh -eux <<'EOF'
git config --global --add safe.directory /data
cmake -S /data -B /tmp/Build -DCMAKE_BUILD_TYPE=Release -DWITH_FULL_RELEASE=On -DWITH_CLUB_FANTASTIC=On
cmake --build /tmp/Build -j $(nproc)
cmake --build /tmp/Build --target package