Skip to content

Commit

Permalink
Build: Fix out-of-tree CMake scmversion extraction on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
stenzek committed Dec 8, 2024
1 parent b6eb41e commit 1adf36c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/scmversion/gen_scmversion.bat
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
@echo off

SET VERSIONFILE="scmversion.cpp"
PUSHD %~dp0
FOR /F "tokens=* USEBACKQ" %%g IN (`git rev-parse HEAD`) do (SET "HASH=%%g")
FOR /F "tokens=* USEBACKQ" %%g IN (`git rev-parse --abbrev-ref HEAD`) do (SET "BRANCH=%%g")
FOR /F "tokens=* USEBACKQ" %%g IN (`git describe --dirty`) do (SET "TAG=%%g")
FOR /F "tokens=* USEBACKQ" %%g IN (`git log -1 --date=iso8601-strict "--format=%%cd"`) do (SET "CDATE=%%g")
POPD

SET SIGNATURELINE=// %HASH% %BRANCH% %TAG% %CDATE%
SET /P EXISTINGLINE=< %VERSIONFILE%
Expand Down

0 comments on commit 1adf36c

Please sign in to comment.