3 REM ~ Copyright 2002-2007 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)
22 REM Output an error message and set the errorlevel to indicate failure.
27 ECHO ### You can specify the toolset as the argument
, i.e.
:
28 ECHO ### .
\build.bat msvc
30 ECHO ### Toolsets supported by this script are
: borland
, como
, gcc
,
31 ECHO ### gcc
-nocygwin
, intel
-win32
, metrowerks
, mingw
,
32 ECHO ### vc11
, vc12
, vc14
, vc141
, vc142
34 ECHO ###
If you have Visual Studio
2017 installed you will need to either update
35 ECHO ### the Visual Studio
2017 installer or
run from VS
2017 Command Prompt
36 ECHO ### as we where unable to detect your toolset installation.
44 REM Tests whether the given string is in the form of an option: "--*"
56 if not "-" == "%test:~1,1%" call :Set_Error
63 REM Tests whether the given string is not empty
75 if not "" == "%test%" call :Set_Error
83 REM Try and guess the toolset to bootstrap the build with...
84 REM Sets B2_TOOLSET to the first found toolset.
85 REM May also set B2_TOOLSET_ROOT to the
86 REM location of the found toolset.
89 call :Test_Empty "%ProgramFiles%"
90 if not errorlevel 1 set "ProgramFiles=C:\Program Files"
92 REM Visual Studio is by default installed to %ProgramFiles% on 32-bit machines and
93 REM %ProgramFiles(x86)% on 64-bit machines. Making a common variable for both.
95 call :Test_Empty "%ProgramFiles(x86)%"
97 set "VS_ProgramFiles=%ProgramFiles(x86)%"
99 set "VS_ProgramFiles=%ProgramFiles%"
102 call guess_toolset.bat
104 call :Error_Print "Could not find a suitable toolset.")
115 REM If no arguments guess the toolset;
116 REM or if first argument is an option guess the toolset;
117 REM otherwise the argument is the toolset to use.
120 if not errorlevel 1 (
122 if not errorlevel 1 ( goto Setup_Toolset
) else ( goto Finish
)
127 if not errorlevel 1 (
129 if not errorlevel 1 ( goto Setup_Toolset
) else ( goto Finish
)
139 REM Setup the toolset command and options. This bit of code
140 REM needs to be flexible enough to handle both when
141 REM the toolset was guessed at and found, or when the toolset
142 REM was indicated in the command arguments.
143 REM NOTE: The strange multiple "if ?? == _toolset_" tests are that way
144 REM because in BAT variables are subsituted only once during a single
145 REM command. A complete "if ... else ..."
146 REM is a single command, even though it's in multiple lines here.
150 if not errorlevel 1 goto Config_Toolset
154 set B2_BUILD_ARGS
=%B2_BUILD_ARGS% %1
159 call config_toolset.bat
160 if "_%_known_%_" == "__" (
161 call :Error_Print "Unknown toolset: %B2_TOOLSET%"
163 if errorlevel 1 goto Finish
166 echo ### Using
'%B2_TOOLSET%' toolset.
170 set B2_SOURCES
=%B2_SOURCES% builtins.cpp class.cpp
171 set B2_SOURCES
=%B2_SOURCES% command.cpp compile.cpp constants.cpp cwd.cpp
172 set B2_SOURCES
=%B2_SOURCES% debug.cpp debugger.cpp
173 set B2_SOURCES
=%B2_SOURCES% execcmd.cpp execnt.cpp filent.cpp filesys.cpp frames.cpp function.cpp
174 set B2_SOURCES
=%B2_SOURCES% glob.cpp hash.cpp hcache.cpp hdrmacro.cpp headers.cpp jam.cpp
175 set B2_SOURCES
=%B2_SOURCES% jambase.cpp jamgram.cpp lists.cpp make.cpp make1.cpp md5.cpp
mem.cpp modules.cpp
176 set B2_SOURCES
=%B2_SOURCES% native.cpp object.cpp option.cpp output.cpp parse.cpp pathnt.cpp
177 set B2_SOURCES
=%B2_SOURCES% pathsys.cpp regexp.cpp rules.cpp scan.cpp search.cpp strings.cpp
178 set B2_SOURCES
=%B2_SOURCES% subst.cpp sysinfo.cpp timestamp.cpp variable.cpp w32_getreg.cpp
179 set B2_SOURCES
=%B2_SOURCES% modules
/order.cpp
180 set B2_SOURCES
=%B2_SOURCES% modules
/path.cpp
181 set B2_SOURCES
=%B2_SOURCES% modules
/property
-set.cpp
182 set B2_SOURCES
=%B2_SOURCES% modules
/regex.cpp
183 set B2_SOURCES
=%B2_SOURCES% modules
/sequence.cpp
184 set B2_SOURCES
=%B2_SOURCES% modules
/set.cpp
186 set B2_CXXFLAGS
=%B2_CXXFLAGS% -DNDEBUG
189 %B2_CXX% %CXXFLAGS% %B2_CXXFLAGS% %B2_SOURCES% %B2_CXX_LINK%
191 copy /b .
\b2.exe .
\bjam.exe
194 @
exit /b
%ERRORLEVEL%