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