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

SET solution=%1
SET version=%2
SET log=build_%version%.log
7 8 9 10
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
11

12 13 14 15 16 17 18 19 20 21
SET packages=
IF EXIST "..\..\..\..\libsodium\builds/msvc/vs2015\libsodium.import.props" (
    COPY /Y "..\..\..\..\libsodium\builds/msvc/vs2015\libsodium.import.props" . > %log%
    IF errorlevel 1 GOTO error
    SET packages=%packages% /p:HAVE_LIBSODIUM=1
) ELSE (
    ECHO Building without libsodium
)

ECHO Building %solution%... (%packages%)
evoskuil's avatar
evoskuil committed
22 23 24 25 26

CALL %environment% x86 > nul
ECHO Platform=x86

ECHO Configuration=DynDebug
27
msbuild /m /v:n /p:Configuration=DynDebug /p:Platform=Win32 %packages% %solution% > %log%
evoskuil's avatar
evoskuil committed
28 29
IF errorlevel 1 GOTO error
ECHO Configuration=DynRelease
30
msbuild /m /v:n /p:Configuration=DynRelease /p:Platform=Win32 %packages% %solution% >> %log%
evoskuil's avatar
evoskuil committed
31 32
IF errorlevel 1 GOTO error
ECHO Configuration=LtcgDebug
33
msbuild /m /v:n /p:Configuration=LtcgDebug /p:Platform=Win32 %packages% %solution% >> %log%
evoskuil's avatar
evoskuil committed
34 35
IF errorlevel 1 GOTO error
ECHO Configuration=LtcgRelease
36
msbuild /m /v:n /p:Configuration=LtcgRelease /p:Platform=Win32 %packages% %solution% >> %log%
evoskuil's avatar
evoskuil committed
37 38
IF errorlevel 1 GOTO error
ECHO Configuration=StaticDebug
39
msbuild /m /v:n /p:Configuration=StaticDebug /p:Platform=Win32 %packages% %solution% >> %log%
evoskuil's avatar
evoskuil committed
40 41
IF errorlevel 1 GOTO error
ECHO Configuration=StaticRelease
42
msbuild /m /v:n /p:Configuration=StaticRelease /p:Platform=Win32 %packages% %solution% >> %log%
evoskuil's avatar
evoskuil committed
43 44 45 46 47 48
IF errorlevel 1 GOTO error

CALL %environment% x86_amd64 > nul
ECHO Platform=x64

ECHO Configuration=DynDebug
49
msbuild /m /v:n /p:Configuration=DynDebug /p:Platform=x64 %packages% %solution% > %log%
evoskuil's avatar
evoskuil committed
50 51
IF errorlevel 1 GOTO error
ECHO Configuration=DynRelease
52
msbuild /m /v:n /p:Configuration=DynRelease /p:Platform=x64 %packages% %solution% >> %log%
evoskuil's avatar
evoskuil committed
53 54
IF errorlevel 1 GOTO error
ECHO Configuration=LtcgDebug
55
msbuild /m /v:n /p:Configuration=LtcgDebug /p:Platform=x64 %packages% %solution% >> %log%
evoskuil's avatar
evoskuil committed
56 57
IF errorlevel 1 GOTO error
ECHO Configuration=LtcgRelease
58
msbuild /m /v:n /p:Configuration=LtcgRelease /p:Platform=x64 %packages% %solution% >> %log%
evoskuil's avatar
evoskuil committed
59 60
IF errorlevel 1 GOTO error
ECHO Configuration=StaticDebug
61
msbuild /m /v:n /p:Configuration=StaticDebug /p:Platform=x64 %packages% %solution% >> %log%
evoskuil's avatar
evoskuil committed
62 63
IF errorlevel 1 GOTO error
ECHO Configuration=StaticRelease
64
msbuild /m /v:n /p:Configuration=StaticRelease /p:Platform=x64 %packages% %solution% >> %log%
evoskuil's avatar
evoskuil committed
65 66 67 68 69 70
IF errorlevel 1 GOTO error

ECHO Complete: %solution%
GOTO end

:error
71 72 73 74 75
ECHO *** ERROR, build terminated early, see: %log%
GOTO end

:no_tools
ECHO *** ERROR, build tools not found: %tools%
evoskuil's avatar
evoskuil committed
76 77 78

:end