1
mirror of https://github.com/jedisct1/libsodium.git synced 2024-12-24 20:45:17 -07:00
libsodium/builds/msvc/build/buildbase.bat

108 lines
3.4 KiB
Batchfile
Raw Normal View History

2014-05-12 02:07:54 -07:00
@ECHO OFF
2019-04-03 05:56:28 -07:00
REM Usage: [buildbase.bat ..\vs2019\mysolution.sln 16]
2014-05-12 02:07:54 -07:00
SETLOCAL enabledelayedexpansion
2014-05-12 02:07:54 -07:00
SET solution=%1
SET version=%2
SET log=build_%version%.log
SET tools=Microsoft Visual Studio %version%.0\VC\vcvarsall.bat
2021-11-08 14:14:11 -07:00
IF %version% == 17 (
SET tools=Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat
SET environment="%programfiles%\!tools!"
IF NOT EXIST !environment! (
SET environment="%programfiles(x86)%\!tools!"
IF NOT EXIST !environment! (
SET tools=Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsall.bat
)
)
)
IF %version% == 16 (
SET tools=Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat
SET environment="%programfiles%\!tools!"
IF NOT EXIST !environment! (
SET environment="%programfiles(x86)%\!tools!"
IF NOT EXIST !environment! (
SET tools=Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat
)
)
)
IF %version% == 15 (
SET tools=Microsoft Visual Studio\2017\Enterprise\VC\Auxiliary\Build\vcvarsall.bat
SET environment="%programfiles%\!tools!"
IF NOT EXIST !environment! (
SET environment="%programfiles(x86)%\!tools!"
IF NOT EXIST !environment! (
SET tools=Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat
)
)
)
SET environment="%programfiles%\!tools!"
IF NOT EXIST !environment! SET environment="%programfiles(x86)%\!tools!"
ECHO Environment: !environment!
IF NOT EXIST !environment! GOTO no_tools
2014-05-12 02:07:54 -07:00
ECHO Building: %solution%
CALL !environment! x86 > nul
2014-05-12 02:07:54 -07:00
ECHO Platform=x86
ECHO Configuration=DynDebug
msbuild /m /v:n /p:Configuration=DynDebug /p:Platform=Win32 %solution% >> %log%
2014-05-12 02:07:54 -07:00
IF errorlevel 1 GOTO error
ECHO Configuration=DynRelease
msbuild /m /v:n /p:Configuration=DynRelease /p:Platform=Win32 %solution% >> %log%
IF errorlevel 1 GOTO error
ECHO Configuration=LtcgDebug
msbuild /m /v:n /p:Configuration=LtcgDebug /p:Platform=Win32 %solution% >> %log%
IF errorlevel 1 GOTO error
ECHO Configuration=LtcgRelease
msbuild /m /v:n /p:Configuration=LtcgRelease /p:Platform=Win32 %solution% >> %log%
IF errorlevel 1 GOTO error
ECHO Configuration=StaticDebug
msbuild /m /v:n /p:Configuration=StaticDebug /p:Platform=Win32 %solution% >> %log%
IF errorlevel 1 GOTO error
ECHO Configuration=StaticRelease
msbuild /m /v:n /p:Configuration=StaticRelease /p:Platform=Win32 %solution% >> %log%
IF errorlevel 1 GOTO error
CALL !environment! x86_amd64 > nul
2014-05-12 02:07:54 -07:00
ECHO Platform=x64
ECHO Configuration=DynDebug
msbuild /m /v:n /p:Configuration=DynDebug /p:Platform=x64 %solution% >> %log%
2014-05-12 02:07:54 -07:00
IF errorlevel 1 GOTO error
ECHO Configuration=DynRelease
msbuild /m /v:n /p:Configuration=DynRelease /p:Platform=x64 %solution% >> %log%
IF errorlevel 1 GOTO error
ECHO Configuration=LtcgDebug
msbuild /m /v:n /p:Configuration=LtcgDebug /p:Platform=x64 %solution% >> %log%
IF errorlevel 1 GOTO error
ECHO Configuration=LtcgRelease
msbuild /m /v:n /p:Configuration=LtcgRelease /p:Platform=x64 %solution% >> %log%
IF errorlevel 1 GOTO error
ECHO Configuration=StaticDebug
msbuild /m /v:n /p:Configuration=StaticDebug /p:Platform=x64 %solution% >> %log%
IF errorlevel 1 GOTO error
ECHO Configuration=StaticRelease
msbuild /m /v:n /p:Configuration=StaticRelease /p:Platform=x64 %solution% >> %log%
IF errorlevel 1 GOTO error
ECHO Complete: %solution%
GOTO end
:error
ECHO *** ERROR, build terminated early, see: %log%
GOTO end
:no_tools
ECHO *** ERROR, build tools not found: !tools!
2014-05-12 02:07:54 -07:00
:end