1 1.1 riastrad @ECHO OFF 2 1.1 riastrad REM Usage: [buildbase.bat ..\vs2013\mysolution.sln 12] 3 1.1 riastrad 4 1.1 riastrad SET solution=%1 5 1.1 riastrad SET version=%2 6 1.1 riastrad SET log=build_%version%.log 7 1.1 riastrad SET tools=Microsoft Visual Studio %version%.0\VC\vcvarsall.bat 8 1.1 riastrad IF %version% == 15 SET tools=Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat 9 1.1 riastrad SET environment="%programfiles(x86)%\%tools%" 10 1.1 riastrad IF NOT EXIST %environment% SET environment="%programfiles%\%tools%" 11 1.1 riastrad IF NOT EXIST %environment% GOTO no_tools 12 1.1 riastrad 13 1.1 riastrad ECHO Building: %solution% 14 1.1 riastrad 15 1.1 riastrad CALL %environment% x86 > nul 16 1.1 riastrad ECHO Platform=x86 17 1.1 riastrad 18 1.1 riastrad ECHO Configuration=DynDebug 19 1.1 riastrad msbuild /m /v:n /p:Configuration=DynDebug /p:Platform=Win32 %solution% >> %log% 20 1.1 riastrad IF errorlevel 1 GOTO error 21 1.1 riastrad ECHO Configuration=DynRelease 22 1.1 riastrad msbuild /m /v:n /p:Configuration=DynRelease /p:Platform=Win32 %solution% >> %log% 23 1.1 riastrad IF errorlevel 1 GOTO error 24 1.1 riastrad ECHO Configuration=LtcgDebug 25 1.1 riastrad msbuild /m /v:n /p:Configuration=LtcgDebug /p:Platform=Win32 %solution% >> %log% 26 1.1 riastrad IF errorlevel 1 GOTO error 27 1.1 riastrad ECHO Configuration=LtcgRelease 28 1.1 riastrad msbuild /m /v:n /p:Configuration=LtcgRelease /p:Platform=Win32 %solution% >> %log% 29 1.1 riastrad IF errorlevel 1 GOTO error 30 1.1 riastrad ECHO Configuration=StaticDebug 31 1.1 riastrad msbuild /m /v:n /p:Configuration=StaticDebug /p:Platform=Win32 %solution% >> %log% 32 1.1 riastrad IF errorlevel 1 GOTO error 33 1.1 riastrad ECHO Configuration=StaticRelease 34 1.1 riastrad msbuild /m /v:n /p:Configuration=StaticRelease /p:Platform=Win32 %solution% >> %log% 35 1.1 riastrad IF errorlevel 1 GOTO error 36 1.1 riastrad 37 1.1 riastrad CALL %environment% x86_amd64 > nul 38 1.1 riastrad ECHO Platform=x64 39 1.1 riastrad 40 1.1 riastrad ECHO Configuration=DynDebug 41 1.1 riastrad msbuild /m /v:n /p:Configuration=DynDebug /p:Platform=x64 %solution% >> %log% 42 1.1 riastrad IF errorlevel 1 GOTO error 43 1.1 riastrad ECHO Configuration=DynRelease 44 1.1 riastrad msbuild /m /v:n /p:Configuration=DynRelease /p:Platform=x64 %solution% >> %log% 45 1.1 riastrad IF errorlevel 1 GOTO error 46 1.1 riastrad ECHO Configuration=LtcgDebug 47 1.1 riastrad msbuild /m /v:n /p:Configuration=LtcgDebug /p:Platform=x64 %solution% >> %log% 48 1.1 riastrad IF errorlevel 1 GOTO error 49 1.1 riastrad ECHO Configuration=LtcgRelease 50 1.1 riastrad msbuild /m /v:n /p:Configuration=LtcgRelease /p:Platform=x64 %solution% >> %log% 51 1.1 riastrad IF errorlevel 1 GOTO error 52 1.1 riastrad ECHO Configuration=StaticDebug 53 1.1 riastrad msbuild /m /v:n /p:Configuration=StaticDebug /p:Platform=x64 %solution% >> %log% 54 1.1 riastrad IF errorlevel 1 GOTO error 55 1.1 riastrad ECHO Configuration=StaticRelease 56 1.1 riastrad msbuild /m /v:n /p:Configuration=StaticRelease /p:Platform=x64 %solution% >> %log% 57 1.1 riastrad IF errorlevel 1 GOTO error 58 1.1 riastrad 59 1.1 riastrad ECHO Complete: %solution% 60 1.1 riastrad GOTO end 61 1.1 riastrad 62 1.1 riastrad :error 63 1.1 riastrad ECHO *** ERROR, build terminated early, see: %log% 64 1.1 riastrad GOTO end 65 1.1 riastrad 66 1.1 riastrad :no_tools 67 1.1 riastrad ECHO *** ERROR, build tools not found: %tools% 68 1.1 riastrad 69 1.1 riastrad :end 70 1.1 riastrad 71