diff options
| author | Jeroen van Rijn <Kelimion@users.noreply.github.com> | 2023-04-11 11:55:29 +0200 |
|---|---|---|
| committer | Jeroen van Rijn <Kelimion@users.noreply.github.com> | 2023-04-11 11:55:29 +0200 |
| commit | b42bb5be26eef651f886810778ee931cf37a8d6b (patch) | |
| tree | 441d354d6c76320605fd89ca33b961c1b0771cfd /build.bat | |
| parent | b052da10657814860402d00ae9434864b7836864 (diff) | |
Only try to parse git hash if .git is present
Closes 2451
Diffstat (limited to 'build.bat')
| -rw-r--r-- | build.bat | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -48,8 +48,11 @@ set odin_version_raw="dev-%curr_year%-%curr_month%" set compiler_flags= -nologo -Oi -TP -fp:precise -Gm- -MP -FC -EHsc- -GR- -GF set compiler_defines= -DODIN_VERSION_RAW=\"%odin_version_raw%\" +if not exist .git\ goto skip_git_hash for /f %%i in ('git rev-parse --short HEAD') do set GIT_SHA=%%i if %ERRORLEVEL% equ 0 set compiler_defines=%compiler_defines% -DGIT_SHA=\"%GIT_SHA%\" +:skip_git_hash + if %nightly% equ 1 set compiler_defines=%compiler_defines% -DNIGHTLY if %release_mode% EQU 0 ( rem Debug |