1@ECHO OFF 2 3REM ~ Copyright 2002-2018 Rene Rivera. 4REM ~ Distributed under the Boost Software License, Version 1.0. 5REM ~ (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) 6 7:Start 8REM Setup the toolset command and options. 9if "_%B2_TOOLSET%_" == "_msvc_" call :Config_MSVC 10if "_%B2_TOOLSET%_" == "_vc12_" call :Config_VC12 11if "_%B2_TOOLSET%_" == "_vc14_" call :Config_VC14 12if "_%B2_TOOLSET%_" == "_vc141_" call :Config_VC141 13if "_%B2_TOOLSET%_" == "_vc142_" call :Config_VC142 14if "_%B2_TOOLSET%_" == "_borland_" call :Config_BORLAND 15if "_%B2_TOOLSET%_" == "_como_" call :Config_COMO 16if "_%B2_TOOLSET%_" == "_gcc_" call :Config_GCC 17if "_%B2_TOOLSET%_" == "_gcc-nocygwin_" call :Config_GCC_NOCYGWIN 18if "_%B2_TOOLSET%_" == "_intel-win32_" call :Config_INTEL_WIN32 19if "_%B2_TOOLSET%_" == "_mingw_" call :Config_MINGW 20exit /b %errorlevel% 21 22:Call_If_Exists 23ECHO Call_If_Exists %* 24if EXIST %1 call %* 25goto :eof 26 27:Config_MSVC 28if not defined CXX ( set "CXX=cl" ) 29if NOT "_%MSVCDir%_" == "__" ( 30 set "B2_TOOLSET_ROOT=%MSVCDir%\" 31 ) 32call :Call_If_Exists "%B2_TOOLSET_ROOT%bin\VCVARS32.BAT" 33if not "_%B2_TOOLSET_ROOT%_" == "__" ( 34 set "PATH=%B2_TOOLSET_ROOT%bin;%PATH%" 35 ) 36set "B2_CXX=%CXX% /nologo /MP /MT /TP /Feb2 /wd4996 /O2 /GL" 37set "B2_CXX_LINK=/link kernel32.lib advapi32.lib user32.lib" 38set "_known_=1" 39goto :eof 40 41:Config_VC11 42if not defined CXX ( set "CXX=cl" ) 43if NOT "_%VS110COMNTOOLS%_" == "__" ( 44 set "B2_TOOLSET_ROOT=%VS110COMNTOOLS%..\..\VC\" 45 ) 46if "_%VCINSTALLDIR%_" == "__" call :Call_If_Exists "%B2_TOOLSET_ROOT%VCVARSALL.BAT" %B2_BUILD_ARGS% 47if NOT "_%B2_TOOLSET_ROOT%_" == "__" ( 48 if "_%VCINSTALLDIR%_" == "__" ( 49 set "PATH=%B2_TOOLSET_ROOT%bin;%PATH%" 50 ) ) 51set "B2_CXX=%CXX% /nologo /MP /MT /TP /Feb2 /wd4996 /O2 /GL" 52set "B2_CXX_LINK=/link kernel32.lib advapi32.lib user32.lib" 53set "_known_=1" 54goto :eof 55 56:Config_VC12 57if not defined CXX ( set "CXX=cl" ) 58if NOT "_%VS120COMNTOOLS%_" == "__" ( 59 set "B2_TOOLSET_ROOT=%VS120COMNTOOLS%..\..\VC\" 60 ) 61 62if "_%B2_ARCH%_" == "__" set B2_ARCH=%PROCESSOR_ARCHITECTURE% 63set B2_BUILD_ARGS=%B2_BUILD_ARGS% %B2_ARCH% 64 65if "_%VCINSTALLDIR%_" == "__" call :Call_If_Exists "%B2_TOOLSET_ROOT%VCVARSALL.BAT" %B2_BUILD_ARGS% 66if NOT "_%B2_TOOLSET_ROOT%_" == "__" ( 67 if "_%VCINSTALLDIR%_" == "__" ( 68 set "PATH=%B2_TOOLSET_ROOT%bin;%PATH%" 69 ) ) 70set "B2_CXX=%CXX% /nologo /MP /MT /TP /Feb2 /wd4996 /O2 /GL" 71set "B2_CXX_LINK=/link kernel32.lib advapi32.lib user32.lib" 72set "_known_=1" 73goto :eof 74 75:Config_VC14 76if not defined CXX ( set "CXX=cl" ) 77if "_%B2_TOOLSET_ROOT%_" == "__" ( 78 if NOT "_%VS140COMNTOOLS%_" == "__" ( 79 set "B2_TOOLSET_ROOT=%VS140COMNTOOLS%..\..\VC\" 80 )) 81 82if "_%B2_ARCH%_" == "__" set B2_ARCH=%PROCESSOR_ARCHITECTURE% 83set B2_BUILD_ARGS=%B2_BUILD_ARGS% %B2_ARCH% 84 85if "_%VCINSTALLDIR%_" == "__" call :Call_If_Exists "%B2_TOOLSET_ROOT%VCVARSALL.BAT" %B2_BUILD_ARGS% 86if NOT "_%B2_TOOLSET_ROOT%_" == "__" ( 87 if "_%VCINSTALLDIR%_" == "__" ( 88 set "PATH=%B2_TOOLSET_ROOT%bin;%PATH%" 89 ) ) 90set "B2_CXX=%CXX% /nologo /MP /MT /TP /Feb2 /wd4996 /O2 /GL" 91set "B2_CXX_LINK=/link kernel32.lib advapi32.lib user32.lib" 92set "_known_=1" 93goto :eof 94 95:Config_VC141 96if not defined CXX ( set "CXX=cl" ) 97call vswhere_usability_wrapper.cmd 98REM Reset ERRORLEVEL since from now on it's all based on ENV vars 99ver > nul 2> nul 100if "_%B2_TOOLSET_ROOT%_" == "__" ( 101 if NOT "_%VS150COMNTOOLS%_" == "__" ( 102 set "B2_TOOLSET_ROOT=%VS150COMNTOOLS%..\..\VC\" 103 )) 104 105if "_%B2_ARCH%_" == "__" set B2_ARCH=%PROCESSOR_ARCHITECTURE% 106set B2_BUILD_ARGS=%B2_BUILD_ARGS% %B2_ARCH% 107 108REM return to current directory as vsdevcmd_end.bat switches to %USERPROFILE%\Source if it exists. 109pushd %CD% 110if "_%VSINSTALLDIR%_" == "__" call :Call_If_Exists "%B2_TOOLSET_ROOT%Auxiliary\Build\vcvarsall.bat" %B2_BUILD_ARGS% 111popd 112set "B2_CXX=%CXX% /nologo /MP /MT /TP /Feb2 /wd4996 /O2 /GL" 113set "B2_CXX_LINK=/link kernel32.lib advapi32.lib user32.lib" 114set "_known_=1" 115goto :eof 116 117:Config_VC142 118if not defined CXX ( set "CXX=cl" ) 119call vswhere_usability_wrapper.cmd 120REM Reset ERRORLEVEL since from now on it's all based on ENV vars 121ver > nul 2> nul 122if "_%B2_TOOLSET_ROOT%_" == "__" ( 123 if NOT "_%VS160COMNTOOLS%_" == "__" ( 124 set "B2_TOOLSET_ROOT=%VS160COMNTOOLS%..\..\VC\" 125 )) 126 127if "_%B2_ARCH%_" == "__" set B2_ARCH=%PROCESSOR_ARCHITECTURE% 128set B2_BUILD_ARGS=%B2_BUILD_ARGS% %B2_ARCH% 129 130REM return to current directory as vsdevcmd_end.bat switches to %USERPROFILE%\Source if it exists. 131pushd %CD% 132if "_%VSINSTALLDIR%_" == "__" call :Call_If_Exists "%B2_TOOLSET_ROOT%Auxiliary\Build\vcvarsall.bat" %B2_BUILD_ARGS% 133popd 134set "B2_CXX=%CXX% /nologo /MP /MT /TP /Feb2 /wd4996 /O2 /GL" 135set "B2_CXX_LINK=/link kernel32.lib advapi32.lib user32.lib" 136set "_known_=1" 137goto :eof 138 139:Config_VCUNK 140if NOT "_%B2_TOOLSET%_" == "_vcunk_" goto Skip_VCUNK 141call vswhere_usability_wrapper.cmd 142REM Reset ERRORLEVEL since from now on it's all based on ENV vars 143ver > nul 2> nul 144if "_%B2_TOOLSET_ROOT%_" == "__" ( 145 if NOT "_%VSUNKCOMNTOOLS%_" == "__" ( 146 set "B2_TOOLSET_ROOT=%VSUNKCOMNTOOLS%..\..\VC\" 147 )) 148 149if "_%B2_ARCH%_" == "__" set B2_ARCH=%PROCESSOR_ARCHITECTURE% 150set B2_BUILD_ARGS=%B2_BUILD_ARGS% %B2_ARCH% 151 152REM return to current directory as vsdevcmd_end.bat switches to %USERPROFILE%\Source if it exists. 153pushd %CD% 154if "_%VSINSTALLDIR%_" == "__" call :Call_If_Exists "%B2_TOOLSET_ROOT%Auxiliary\Build\vcvarsall.bat" %B2_BUILD_ARGS% 155popd 156set "B2_CXX=%CXX% /nologo /MP /MT /TP /Feb2 /wd4996 /O2 /GL" 157set "B2_CXX_LINK=/link kernel32.lib advapi32.lib user32.lib" 158set "_known_=1" 159goto :eof 160 161:Config_BORLAND 162if not defined CXX ( set "CXX=bcc32" ) 163if "_%B2_TOOLSET_ROOT%_" == "__" ( 164 call guess_toolset.bat test_path bcc32.exe ) 165if "_%B2_TOOLSET_ROOT%_" == "__" ( 166 if not errorlevel 1 ( 167 set "B2_TOOLSET_ROOT=%FOUND_PATH%..\" 168 ) ) 169if not "_%B2_TOOLSET_ROOT%_" == "__" ( 170 set "PATH=%B2_TOOLSET_ROOT%Bin;%PATH%" 171 ) 172set "B2_CXX=%CXX% -tC -P -O2 -w- -I"%B2_TOOLSET_ROOT%Include" -L"%B2_TOOLSET_ROOT%Lib" -Nd -eb2" 173set "_known_=1" 174goto :eof 175 176:Config_COMO 177if not defined CXX ( set "CXX=como" ) 178set "B2_CXX=%CXX% --inlining -o b2.exe" 179set "_known_=1" 180goto :eof 181 182:Config_GCC 183if not defined CXX ( set "CXX=g++" ) 184set "B2_CXX=%CXX% -x c++ -std=c++11 -s -O3 -o b2.exe" 185set "_known_=1" 186goto :eof 187 188:Config_GCC_NOCYGWIN 189if not defined CXX ( set "CXX=g++" ) 190set "B2_CXX=%CXX% -x c++ -std=c++11 -s -O3 -mno-cygwin -o b2.exe" 191set "_known_=1" 192goto :eof 193 194:Config_INTEL_WIN32 195if not defined CXX ( set "CXX=icl" ) 196set "B2_CXX=%CXX% /nologo /MT /O2 /Ob2 /Gy /GF /GA /GB /Feb2" 197set "_known_=1" 198goto :eof 199 200:Config_MINGW 201if not defined CXX ( set "CXX=g++" ) 202if not "_%B2_TOOLSET_ROOT%_" == "__" ( 203 set "PATH=%B2_TOOLSET_ROOT%bin;%PATH%" 204 ) 205for /F "delims=" %%I in ("%CXX%") do set "PATH=%PATH%;%%~dpI" 206set "B2_CXX=%CXX% -x c++ -std=c++11 -s -O3 -o b2.exe" 207set "_known_=1" 208goto :eof 209