2014-05-12 02:17:08 -07:00
|
|
|
@ECHO OFF
|
2016-03-05 04:37:01 -06:00
|
|
|
@setlocal
|
|
|
|
REM Usage: [buildbase.bat ..\vs2013\mysolution.sln 12 [Clean]]
|
2014-05-12 02:17:08 -07:00
|
|
|
|
|
|
|
SET solution=%1
|
|
|
|
SET version=%2
|
2016-03-05 04:37:01 -06:00
|
|
|
|
|
|
|
:: 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
|
|
|
|
|
2014-05-12 02:17:08 -07:00
|
|
|
SET log=build_%version%.log
|
2014-05-13 03:17:34 -07:00
|
|
|
SET tools=Microsoft Visual Studio %version%.0\VC\vcvarsall.bat
|
2017-03-19 18:38:43 -04:00
|
|
|
if "%version%" == "15" SET tools=Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat
|
2014-05-13 03:17:34 -07:00
|
|
|
SET environment="%programfiles(x86)%\%tools%"
|
|
|
|
IF NOT EXIST %environment% SET environment="%programfiles%\%tools%"
|
|
|
|
IF NOT EXIST %environment% GOTO no_tools
|
2014-05-12 02:17:08 -07:00
|
|
|
|
2016-05-13 00:56:09 -07:00
|
|
|
@ECHO %ACTION% %solution%
|
2016-03-05 04:37:01 -06:00
|
|
|
|
2017-10-05 22:46:29 +03:00
|
|
|
SET __CURRENT_DIR__=%CD%
|
2016-03-05 04:37:01 -06:00
|
|
|
CALL %environment% x86 >%SystemDrive%\nul 2>&1
|
|
|
|
ECHO Platform=x86 2> %log%
|
2017-10-05 22:46:29 +03:00
|
|
|
CD /D %__CURRENT_DIR__%
|
|
|
|
SET __CURRENT_DIR__=
|
|
|
|
|
2014-05-12 02:17:08 -07:00
|
|
|
|
|
|
|
ECHO Configuration=DynDebug
|
2016-05-13 00:56:09 -07:00
|
|
|
msbuild /m /v:n /p:Configuration=DynDebug /p:Platform=Win32 %solution% %target%>> %log% || GOTO error
|
2014-05-12 02:17:08 -07:00
|
|
|
ECHO Configuration=DynRelease
|
2016-05-13 00:56:09 -07:00
|
|
|
msbuild /m /v:n /p:Configuration=DynRelease /p:Platform=Win32 %solution% %target%>> %log% || GOTO error
|
2014-05-12 02:17:08 -07:00
|
|
|
ECHO Configuration=LtcgDebug
|
2016-05-13 00:56:09 -07:00
|
|
|
msbuild /m /v:n /p:Configuration=LtcgDebug /p:Platform=Win32 %solution% %target%>> %log% || GOTO error
|
2014-05-12 02:17:08 -07:00
|
|
|
ECHO Configuration=LtcgRelease
|
2016-05-13 00:56:09 -07:00
|
|
|
msbuild /m /v:n /p:Configuration=LtcgRelease /p:Platform=Win32 %solution% %target%>> %log% || GOTO error
|
2014-05-12 02:17:08 -07:00
|
|
|
ECHO Configuration=StaticDebug
|
2016-05-13 00:56:09 -07:00
|
|
|
msbuild /m /v:n /p:Configuration=StaticDebug /p:Platform=Win32 %solution% %target%>> %log% || GOTO error
|
2014-05-12 02:17:08 -07:00
|
|
|
ECHO Configuration=StaticRelease
|
2016-05-13 00:56:09 -07:00
|
|
|
msbuild /m /v:n /p:Configuration=StaticRelease /p:Platform=Win32 %solution% %target%>> %log% || GOTO error
|
2014-05-12 02:17:08 -07:00
|
|
|
|
2017-10-05 22:46:29 +03:00
|
|
|
SET __CURRENT_DIR__=%CD%
|
2016-03-05 04:37:01 -06:00
|
|
|
CALL %environment% x86_amd64 >%SystemDrive%\nul 2>&1
|
2014-05-12 02:17:08 -07:00
|
|
|
ECHO Platform=x64
|
2017-10-05 22:46:29 +03:00
|
|
|
CD /D %__CURRENT_DIR__%
|
|
|
|
SET __CURRENT_DIR__=
|
|
|
|
|
2014-05-12 02:17:08 -07:00
|
|
|
|
|
|
|
ECHO Configuration=DynDebug
|
2016-05-13 00:56:09 -07:00
|
|
|
msbuild /m /v:n /p:Configuration=DynDebug /p:Platform=x64 %solution% %target%>> %log% || GOTO error
|
2014-05-12 02:17:08 -07:00
|
|
|
ECHO Configuration=DynRelease
|
2016-05-13 00:56:09 -07:00
|
|
|
msbuild /m /v:n /p:Configuration=DynRelease /p:Platform=x64 %solution% %target%>> %log% || GOTO error
|
2014-05-12 02:17:08 -07:00
|
|
|
ECHO Configuration=LtcgDebug
|
2016-05-13 00:56:09 -07:00
|
|
|
msbuild /m /v:n /p:Configuration=LtcgDebug /p:Platform=x64 %solution% %target%>> %log% || GOTO error
|
2014-05-12 02:17:08 -07:00
|
|
|
ECHO Configuration=LtcgRelease
|
2016-05-13 00:56:09 -07:00
|
|
|
msbuild /m /v:n /p:Configuration=LtcgRelease /p:Platform=x64 %solution% %target%>> %log% || GOTO error
|
2014-05-12 02:17:08 -07:00
|
|
|
ECHO Configuration=StaticDebug
|
2016-05-13 00:56:09 -07:00
|
|
|
msbuild /m /v:n /p:Configuration=StaticDebug /p:Platform=x64 %solution% %target%>> %log% || GOTO error
|
2014-05-12 02:17:08 -07:00
|
|
|
ECHO Configuration=StaticRelease
|
2016-05-13 00:56:09 -07:00
|
|
|
msbuild /m /v:n /p:Configuration=StaticRelease /p:Platform=x64 %solution% %target%>> %log% || GOTO error
|
2014-05-12 02:17:08 -07:00
|
|
|
|
2016-03-05 04:37:01 -06:00
|
|
|
ECHO %ACTION% complete: %solution%
|
2014-05-12 02:17:08 -07:00
|
|
|
GOTO end
|
|
|
|
|
|
|
|
:error
|
2014-05-13 03:17:34 -07:00
|
|
|
ECHO *** ERROR, build terminated early, see: %log%
|
|
|
|
GOTO end
|
|
|
|
|
|
|
|
:no_tools
|
|
|
|
ECHO *** ERROR, build tools not found: %tools%
|
2014-05-12 02:17:08 -07:00
|
|
|
|
|
|
|
:end
|
2016-03-05 04:37:01 -06:00
|
|
|
@endlocal
|