3 REM ~ Copyright 2002-2018 Rene Rivera.
4 REM ~ Distributed under the Boost Software License, Version 1.0.
5 REM ~ (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
8 REM Setup the toolset command and options.
9 if "_%B2_TOOLSET%_" == "_msvc_" call :Config_MSVC
10 if "_%B2_TOOLSET%_" == "_vc12_" call :Config_VC12
11 if "_%B2_TOOLSET%_" == "_vc14_" call :Config_VC14
12 if "_%B2_TOOLSET%_" == "_vc141_" call :Config_VC141
13 if "_%B2_TOOLSET%_" == "_vc142_" call :Config_VC142
14 if "_%B2_TOOLSET%_" == "_borland_" call :Config_BORLAND
15 if "_%B2_TOOLSET%_" == "_como_" call :Config_COMO
16 if "_%B2_TOOLSET%_" == "_gcc_" call :Config_GCC
17 if "_%B2_TOOLSET%_" == "_gcc-nocygwin_" call :Config_GCC_NOCYGWIN
18 if "_%B2_TOOLSET%_" == "_intel-win32_" call :Config_INTEL_WIN32
19 if "_%B2_TOOLSET%_" == "_mingw_" call :Config_MINGW
23 ECHO Call_If_Exists
%*
28 if not defined CXX
( set "CXX=cl" )
29 if NOT "_%MSVCDir%_" == "__" (
30 set "B2_TOOLSET_ROOT=%MSVCDir%\"
32 call :Call_If_Exists "%B2_TOOLSET_ROOT%bin\VCVARS32.BAT
"
33 if not "_
%B2_TOOLSET_ROOT%_
" == "__
" (
34 set "PATH=%B2_TOOLSET_ROOT%bin
;%PATH%"
36 set "B2_CXX
=%CXX% /nologo
/MP
/MT
/TP
/Feb2
/wd4996
/O2
/GL
"
37 set "B2_CXX_LINK
=/link kernel32.lib advapi32.lib user32.lib
"
42 if not defined CXX ( set "CXX
=cl
" )
43 if NOT "_
%VS110COMNTOOLS%_
" == "__
" (
44 set "B2_TOOLSET_ROOT
=%VS110COMNTOOLS%..\..\VC
\"
46 if "_%VCINSTALLDIR%_" == "__" call :Call_If_Exists "%B2_TOOLSET_ROOT%VCVARSALL.BAT" %B2_BUILD_ARGS%
47 if NOT "_%B2_TOOLSET_ROOT%_" == "__" (
48 if "_%VCINSTALLDIR%_" == "__" (
49 set "PATH=%B2_TOOLSET_ROOT%bin;%PATH%"
51 set "B2_CXX=%CXX% /nologo /MP /MT /TP /Feb2 /wd4996 /O2 /GL"
52 set "B2_CXX_LINK=/link kernel32.lib advapi32.lib user32.lib"
57 if not defined CXX
( set "CXX=cl" )
58 if NOT "_%VS120COMNTOOLS%_" == "__" (
59 set "B2_TOOLSET_ROOT=%VS120COMNTOOLS%..\..\VC\"
62 if "_
%B2_ARCH%_
" == "__
" set B2_ARCH=%PROCESSOR_ARCHITECTURE%
63 set B2_BUILD_ARGS=%B2_BUILD_ARGS% %B2_ARCH%
65 if "_
%VCINSTALLDIR%_
" == "__
" call :Call_If_Exists "%B2_TOOLSET_ROOT%VCVARSALL.BAT
" %B2_BUILD_ARGS%
66 if NOT "_
%B2_TOOLSET_ROOT%_
" == "__
" (
67 if "_
%VCINSTALLDIR%_
" == "__
" (
68 set "PATH=%B2_TOOLSET_ROOT%bin
;%PATH%"
70 set "B2_CXX
=%CXX% /nologo
/MP
/MT
/TP
/Feb2
/wd4996
/O2
/GL
"
71 set "B2_CXX_LINK
=/link kernel32.lib advapi32.lib user32.lib
"
76 if not defined CXX ( set "CXX
=cl
" )
77 if "_
%B2_TOOLSET_ROOT%_
" == "__
" (
78 if NOT "_
%VS140COMNTOOLS%_
" == "__
" (
79 set "B2_TOOLSET_ROOT
=%VS140COMNTOOLS%..\..\VC
\"
82 if "_%B2_ARCH%_" == "__" set B2_ARCH
=%PROCESSOR_ARCHITECTURE%
83 set B2_BUILD_ARGS
=%B2_BUILD_ARGS% %B2_ARCH%
85 if "_%VCINSTALLDIR%_" == "__" call :Call_If_Exists "%B2_TOOLSET_ROOT%VCVARSALL.BAT" %B2_BUILD_ARGS%
86 if NOT "_%B2_TOOLSET_ROOT%_" == "__" (
87 if "_%VCINSTALLDIR%_" == "__" (
88 set "PATH=%B2_TOOLSET_ROOT%bin;%PATH%"
90 set "B2_CXX=%CXX% /nologo /MP /MT /TP /Feb2 /wd4996 /O2 /GL"
91 set "B2_CXX_LINK=/link kernel32.lib advapi32.lib user32.lib"
96 if not defined CXX
( set "CXX=cl" )
97 call vswhere_usability_wrapper.
cmd
98 REM Reset ERRORLEVEL since from now on it's all based on ENV vars
100 if "_%B2_TOOLSET_ROOT%_" == "__" (
101 if NOT "_%VS150COMNTOOLS%_" == "__" (
102 set "B2_TOOLSET_ROOT=%VS150COMNTOOLS%..\..\VC\"
105 if "_
%B2_ARCH%_
" == "__
" set B2_ARCH=%PROCESSOR_ARCHITECTURE%
106 set B2_BUILD_ARGS=%B2_BUILD_ARGS% %B2_ARCH%
108 REM return to current directory as vsdevcmd_end.bat switches to %USERPROFILE%\Source if it exists.
110 if "_
%VSINSTALLDIR%_
" == "__
" call :Call_If_Exists "%B2_TOOLSET_ROOT%Auxiliary\Build
\vcvarsall.bat
" %B2_BUILD_ARGS%
112 set "B2_CXX
=%CXX% /nologo
/MP
/MT
/TP
/Feb2
/wd4996
/O2
/GL
"
113 set "B2_CXX_LINK
=/link kernel32.lib advapi32.lib user32.lib
"
118 if not defined CXX ( set "CXX
=cl
" )
119 call vswhere_usability_wrapper.cmd
120 REM Reset ERRORLEVEL since from now on it's all based on ENV vars
122 if "_
%B2_TOOLSET_ROOT%_
" == "__
" (
123 if NOT "_
%VS160COMNTOOLS%_
" == "__
" (
124 set "B2_TOOLSET_ROOT
=%VS160COMNTOOLS%..\..\VC
\"
127 if "_%B2_ARCH%_" == "__" set B2_ARCH
=%PROCESSOR_ARCHITECTURE%
128 set B2_BUILD_ARGS
=%B2_BUILD_ARGS% %B2_ARCH%
130 REM return to current directory as vsdevcmd_end.bat switches to %USERPROFILE%\Source if it exists.
132 if "_%VSINSTALLDIR%_" == "__" call :Call_If_Exists "%B2_TOOLSET_ROOT%Auxiliary\Build\vcvarsall.bat" %B2_BUILD_ARGS%
134 set "B2_CXX=%CXX% /nologo /MP /MT /TP /Feb2 /wd4996 /O2 /GL"
135 set "B2_CXX_LINK=/link kernel32.lib advapi32.lib user32.lib"
140 if NOT "_%B2_TOOLSET%_" == "_vcunk_" goto Skip_VCUNK
141 call vswhere_usability_wrapper.
cmd
142 REM Reset ERRORLEVEL since from now on it's all based on ENV vars
144 if "_%B2_TOOLSET_ROOT%_" == "__" (
145 if NOT "_%VSUNKCOMNTOOLS%_" == "__" (
146 set "B2_TOOLSET_ROOT=%VSUNKCOMNTOOLS%..\..\VC\"
149 if "_
%B2_ARCH%_
" == "__
" set B2_ARCH=%PROCESSOR_ARCHITECTURE%
150 set B2_BUILD_ARGS=%B2_BUILD_ARGS% %B2_ARCH%
152 REM return to current directory as vsdevcmd_end.bat switches to %USERPROFILE%\Source if it exists.
154 if "_
%VSINSTALLDIR%_
" == "__
" call :Call_If_Exists "%B2_TOOLSET_ROOT%Auxiliary\Build
\vcvarsall.bat
" %B2_BUILD_ARGS%
156 set "B2_CXX
=%CXX% /nologo
/MP
/MT
/TP
/Feb2
/wd4996
/O2
/GL
"
157 set "B2_CXX_LINK
=/link kernel32.lib advapi32.lib user32.lib
"
162 if not defined CXX ( set "CXX
=bcc32
" )
163 if "_
%B2_TOOLSET_ROOT%_
" == "__
" (
164 call guess_toolset.bat test_path bcc32.exe )
165 if "_
%B2_TOOLSET_ROOT%_
" == "__
" (
166 if not errorlevel 1 (
167 set "B2_TOOLSET_ROOT
=%FOUND_PATH%..
\"
169 if not "_%B2_TOOLSET_ROOT%_" == "__" (
170 set "PATH=%B2_TOOLSET_ROOT%Bin;%PATH%"
172 set "B2_CXX=%CXX% -tC -P -O2 -w- -I"%B2_TOOLSET_ROOT%Include
" -L"%B2_TOOLSET_ROOT%Lib
" -Nd -eb2"
177 if not defined CXX
( set "CXX=como" )
178 set "B2_CXX=%CXX% --inlining -o b2.exe"
183 if not defined CXX
( set "CXX=g++" )
184 set "B2_CXX=%CXX% -x c++ -std=c++11 -s -O3 -o b2.exe"
189 if not defined CXX
( set "CXX=g++" )
190 set "B2_CXX=%CXX% -x c++ -std=c++11 -s -O3 -mno-cygwin -o b2.exe"
195 if not defined CXX
( set "CXX=icl" )
196 set "B2_CXX=%CXX% /nologo /MT /O2 /Ob2 /Gy /GF /GA /GB /Feb2"
201 if not defined CXX
( set "CXX=g++" )
202 if not "_%B2_TOOLSET_ROOT%_" == "__" (
203 set "PATH=%B2_TOOLSET_ROOT%bin;%PATH%"
205 for /F
"delims=" %%I in
("%CXX%") do set "PATH=%PATH%;%%~dpI"
206 set "B2_CXX=%CXX% -x c++ -std=c++11 -s -O3 -o b2.exe"