diff options
| author | Thomas la Cour <tlc@hyrtwol.dk> | 2024-09-09 19:29:43 +0200 |
|---|---|---|
| committer | Thomas la Cour <tlc@hyrtwol.dk> | 2024-09-09 19:29:43 +0200 |
| commit | 053425e8d7a29fee378437fce02d0db5ca2f7a90 (patch) | |
| tree | 71a1f5c103c1dd2d7ea7000d0ec558e6f894c1e3 /build.bat | |
| parent | 171d917b7e4d0c488f5807fd5ae5928f4b7c625c (diff) | |
trim version digits, release=YYYY.MM.0.0 else YYYY.MM.DD.0
Diffstat (limited to 'build.bat')
| -rw-r--r-- | build.bat | 22 |
1 files changed, 17 insertions, 5 deletions
@@ -45,7 +45,19 @@ if "%2" == "1" ( set nightly=0 ) -set odin_version_raw="dev-%curr_year%-%curr_month%" +if %release_mode% equ 0 ( + set V1=%curr_year% + set V2=%curr_month% + set V3=%curr_day% +) else ( + set V1=%curr_year% + set V2=%curr_month% + set V3=0 +) +set V4=0 +set odin_version_full="%V1%.%V2%.%V3%.%V4%" +set odin_version_raw="dev-%V1%-%V2%" + set compiler_flags= -nologo -Oi -TP -fp:precise -Gm- -MP -FC -EHsc- -GR- -GF rem Parse source code as utf-8 even on shift-jis and other codepages @@ -54,9 +66,9 @@ set compiler_flags= %compiler_flags% /utf-8 set compiler_defines= -DODIN_VERSION_RAW=\"%odin_version_raw%\" rem fileversion is defined as {Major,Minor,Build,Private: u16} so a bit limited -set rc_flags=-nologo -v ^ --DV1=%curr_year% -DV2=%curr_month% -DV3=%curr_day% -DV4=%nightly% ^ --DVF=%curr_year%.%curr_month%.%curr_day%.%nightly% +set rc_flags=-nologo ^ +-DV1=%V1% -DV2=%V2% -DV3=%V3% -DV4=%V4% ^ +-DVF=%odin_version_full% if not exist .git\ goto skip_git_hash for /f "tokens=1,2" %%i IN ('git show "--pretty=%%cd %%h" "--date=format:%%Y-%%m" --no-patch --no-notes HEAD') do ( @@ -122,7 +134,7 @@ del *.ilk > NUL 2> NUL rc %rc_flags% %odin_rc% cl %compiler_settings% "src\main.cpp" "src\libtommath.cpp" /link %linker_settings% -OUT:%exe_name% -mt -nologo -inputresource:%exe_name%;#1 -manifest misc\odin.manifest -outputresource:%exe_name%;#1 -validate_manifest -identity:"odin, processorArchitecture=amd64, version=%curr_year%.%curr_month%.%curr_day%.%nightly%, type=win32" +mt -nologo -inputresource:%exe_name%;#1 -manifest misc\odin.manifest -outputresource:%exe_name%;#1 -validate_manifest -identity:"odin, processorArchitecture=amd64, version=%odin_version_full%, type=win32" if %errorlevel% neq 0 goto end_of_build call build_vendor.bat |