text
stringlengths
0
834k
set test=%test:""###=%
set test=%test:###""=%
set test=%test:###=%
if not """" == ""%test%"" call :Set_Error
:Test_Empty_End
endlocal
goto :eof
:Guess_Toolset
set local
REM Try and guess the toolset to bootstrap the build with...
REM Sets B2_TOOLSET to the first found toolset.
REM May also set B2_TOOLSET_ROOT to the
REM location of the found toolset.
call :Clear_Error
call :Test_Empty ""%ProgramFiles%""
if not errorlevel 1 set ""ProgramFiles=C:\Program Files""
REM Visual Studio is by default installed to %ProgramFiles% on 32-bit machines and
REM %ProgramFiles(x86)% on 64-bit machines. Making a common variable for both.
call :Clear_Error
call :Test_Empty ""%ProgramFiles(x86)%""
if errorlevel 1 (
set ""VS_ProgramFiles=%ProgramFiles(x86)%""
) else (
set ""VS_ProgramFiles=%ProgramFiles%""
)
call guess_toolset.bat
if errorlevel 1 (
call :Error_Print ""Could not find a suitable toolset."")
goto :eof
endlocal
goto :eof
:Start
set B2_TOOLSET=
set B2_BUILD_ARGS=
REM If no arguments guess the toolset;
REM or if first argument is an option guess the toolset;
REM otherwise the argument is the toolset to use.
call :Clear_Error
call :Test_Empty %1
if not errorlevel 1 (
call :Guess_Toolset
if not errorlevel 1 ( goto Setup_Toolset ) else ( goto Finish )
)
call :Clear_Error
call :Test_Option %1
if not errorlevel 1 (
call :Guess_Toolset
if not errorlevel 1 ( goto Setup_Toolset ) else ( goto Finish )
)
call :Clear_Error
set B2_TOOLSET=%1
shift
goto Setup_Toolset
:Setup_Toolset
REM Setup the toolset command and options. This bit of code
REM needs to be flexible enough to handle both when
REM the toolset was guessed at and found, or when the toolset
REM was indicated in the command arguments.
REM NOTE: The strange multiple ""if ?? == _toolset_"" tests are that way
REM because in BAT variables are subsituted only once during a single
REM command. A complete ""if ... else ...""
REM is a single command, even though it's in multiple lines here.
:Setup_Args
call :Clear_Error
call :Test_Empty %1
if not errorlevel 1 goto Config_Toolset
call :Clear_Error
call :Test_Option %1
if errorlevel 1 (
set B2_BUILD_ARGS=%B2_BUILD_ARGS% %1
shift
goto Setup_Args
)
:Config_Toolset
call config_toolset.bat
if ""_%_known_%_"" == ""__"" (
call :Error_Print ""Unknown toolset: %B2_TOOLSET%""
)
if errorlevel 1 goto Finish
echo ###
echo ### Using '%B2_TOOLSET%' toolset.
echo ###
set B2_SOURCES=
set B2_SOURCES=%B2_SOURCES% builtins.cpp class.cpp
set B2_SOURCES=%B2_SOURCES% command.cpp compile.cpp constants.cpp cwd.cpp