buildbase.bat 2.56 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
SET tools=Microsoft Visual Studio %version%.0\VC\vcvarsall.bat
15
if "%version%" == "15" SET tools=Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat
16 17 18
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
19

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

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

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

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

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

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

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

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

:end
65
@endlocal