buildbase.bat 2.46 KB
Newer Older
evoskuil's avatar
evoskuil committed
1
@ECHO OFF
2 3
@setlocal
REM Usage: [buildbase.bat ..\vs2013\mysolution.sln 12 [Clean]]
evoskuil's avatar
evoskuil committed
4 5 6

SET solution=%1
SET version=%2
7 8 9 10 11 12

:: supports passing in Clean as third argument if "make clean" behavior is desired
SET target=%3
SET ACTION=Building
if NOT "%target%" == "" set target=/t:%target%&set ACTION=Cleaning

evoskuil's avatar
evoskuil committed
13
SET log=build_%version%.log
14 15 16 17
SET tools=Microsoft Visual Studio %version%.0\VC\vcvarsall.bat
SET environment="%programfiles(x86)%\%tools%"
IF NOT EXIST %environment% SET environment="%programfiles%\%tools%"
IF NOT EXIST %environment% GOTO no_tools
evoskuil's avatar
evoskuil committed
18

19
@ECHO %ACTION% %solution%
20 21 22

CALL %environment% x86 >%SystemDrive%\nul 2>&1
ECHO Platform=x86 2> %log%
evoskuil's avatar
evoskuil committed
23 24

ECHO Configuration=DynDebug
25
msbuild /m /v:n /p:Configuration=DynDebug /p:Platform=Win32 %solution% %target%>> %log% || GOTO error
evoskuil's avatar
evoskuil committed
26
ECHO Configuration=DynRelease
27
msbuild /m /v:n /p:Configuration=DynRelease /p:Platform=Win32 %solution% %target%>> %log% || GOTO error
evoskuil's avatar
evoskuil committed
28
ECHO Configuration=LtcgDebug
29
msbuild /m /v:n /p:Configuration=LtcgDebug /p:Platform=Win32 %solution% %target%>> %log% || GOTO error
evoskuil's avatar
evoskuil committed
30
ECHO Configuration=LtcgRelease
31
msbuild /m /v:n /p:Configuration=LtcgRelease /p:Platform=Win32 %solution% %target%>> %log% || GOTO error
evoskuil's avatar
evoskuil committed
32
ECHO Configuration=StaticDebug
33
msbuild /m /v:n /p:Configuration=StaticDebug /p:Platform=Win32 %solution% %target%>> %log% || GOTO error
evoskuil's avatar
evoskuil committed
34
ECHO Configuration=StaticRelease
35
msbuild /m /v:n /p:Configuration=StaticRelease /p:Platform=Win32 %solution% %target%>> %log% || GOTO error
evoskuil's avatar
evoskuil committed
36

37
CALL %environment% x86_amd64 >%SystemDrive%\nul 2>&1
evoskuil's avatar
evoskuil committed
38 39 40
ECHO Platform=x64

ECHO Configuration=DynDebug
41
msbuild /m /v:n /p:Configuration=DynDebug /p:Platform=x64 %solution% %target%>> %log% || GOTO error
evoskuil's avatar
evoskuil committed
42
ECHO Configuration=DynRelease
43
msbuild /m /v:n /p:Configuration=DynRelease /p:Platform=x64 %solution% %target%>> %log% || GOTO error
evoskuil's avatar
evoskuil committed
44
ECHO Configuration=LtcgDebug
45
msbuild /m /v:n /p:Configuration=LtcgDebug /p:Platform=x64 %solution% %target%>> %log% || GOTO error
evoskuil's avatar
evoskuil committed
46
ECHO Configuration=LtcgRelease
47
msbuild /m /v:n /p:Configuration=LtcgRelease /p:Platform=x64 %solution% %target%>> %log% || GOTO error
evoskuil's avatar
evoskuil committed
48
ECHO Configuration=StaticDebug
49
msbuild /m /v:n /p:Configuration=StaticDebug /p:Platform=x64 %solution% %target%>> %log% || GOTO error
evoskuil's avatar
evoskuil committed
50
ECHO Configuration=StaticRelease
51
msbuild /m /v:n /p:Configuration=StaticRelease /p:Platform=x64 %solution% %target%>> %log% || GOTO error
evoskuil's avatar
evoskuil committed
52

53
ECHO %ACTION% complete: %solution%
evoskuil's avatar
evoskuil committed
54 55 56
GOTO end

:error
57 58 59 60 61
ECHO *** ERROR, build terminated early, see: %log%
GOTO end

:no_tools
ECHO *** ERROR, build tools not found: %tools%
evoskuil's avatar
evoskuil committed
62 63

:end
64
@endlocal