Update to latest build scripts

This commit is contained in:
zilmar 2017-04-08 09:36:32 +10:00
parent 2fa7af2505
commit a65968171e
2 changed files with 32 additions and 4 deletions

View File

@ -0,0 +1,28 @@
@echo off
SETLOCAL
set origdir=%cd%
cd /d %~dp0..\..
set base_dir=%cd%
cd /d %origdir%
for /f %%i in ('git describe --tags --long') do set GIT_DESCRIBE=%%i > nul
for /F "tokens=1,2,3 delims=-" %%i in ("%GIT_DESCRIBE%") do call :process_git_desc %%i %%j %%k
for /F "tokens=1,2,3" %%i in (%base_dir%\Source\Project64-core\version.h) do call :process_version %%i %%j %%k
set VERSION=v%VERSION_MAJOR%.%VERSION_MINOR%.%VERSION_REVISION%-%VERSION_BUILD%-%VERSION_COMMIT%
echo GIT_DESCRIBE = %VERSION% > "%base_dir%\git.properties"
goto :EOF
:process_git_desc
set VERSION_BUILD=%2
set VERSION_COMMIT=%3
goto :EOF
:process_version
if "%1" == "#define" if "%2" == "VERSION_MAJOR" set VERSION_MAJOR=%3
if "%1" == "#define" if "%2" == "VERSION_MINOR" set VERSION_MINOR=%3
if "%1" == "#define" if "%2" == "VERSION_REVISION" set VERSION_REVISION=%3
goto :EOF

View File

@ -12,17 +12,17 @@ cd /d %~dp0..\..\
set base_dir=%cd%
cd /d %origdir%
if exist "C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\devenv.exe" ( set MSVC-BUILDER="C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\devenv.exe")
if exist "C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\devenv.exe" ( set MSVC-BUILDER="C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\devenv.exe")
if exist "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\devenv.exe" ( set MSVC-BUILDER="C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\devenv.exe")
if exist "C:\Program Files\Microsoft Visual Studio 14.0\Common7\IDE\devenv.exe" ( set MSVC-BUILDER="C:\Program Files\Microsoft Visual Studio 14.0\Common7\IDE\devenv.exe")
if %MSVC-BUILDER% == "" (
echo can not find visual studio 2008
echo can not find visual studio 2015
goto :end
)
:: Build Win32 version of the software
IF EXIST "%base_dir%\output.txt" del "%base_dir%\output.txt"
%MSVC-BUILDER% "%base_dir%\Project64.vs2008.sln" /rebuild "%BuildMode%|Win32" /out "%base_dir%\output.txt"
%MSVC-BUILDER% "%base_dir%\Project64.sln" /rebuild "%BuildMode%|Win32" /out "%base_dir%\output.txt"
set Result=%ERRORLEVEL%
type "%base_dir%\output.txt"
echo Done - ERRORLEVEL: %Result%