Skip to content

Commit aaf1432

Browse files
authored
Add VC143, aka VS2012, aka cl.exe 17.x toolset.
Adds the vc143 preview toolset to bootstrap and build. Note, vc142 is still the default msvc toolset. When vc143 is released it will become the default with a future change.
1 parent 6b09491 commit aaf1432

File tree

5 files changed

+69
-8
lines changed

5 files changed

+69
-8
lines changed

src/engine/build.bat

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ ECHO ### .\build.bat msvc
2929
ECHO ###
3030
ECHO ### Toolsets supported by this script are: borland, como, gcc,
3131
ECHO ### gcc-nocygwin, intel-win32, mingw,
32-
ECHO ### vc12, vc14, vc141, vc142
32+
ECHO ### vc12, vc14, vc141, vc142, vc143
3333
ECHO ###
3434
ECHO ### If you have Visual Studio 2017 installed you will need to either update
3535
ECHO ### the Visual Studio 2017 installer or run from VS 2017 Command Prompt

src/engine/config_toolset.bat

+23
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ if "_%B2_TOOLSET%_" == "_vc12_" call :Config_VC12
1111
if "_%B2_TOOLSET%_" == "_vc14_" call :Config_VC14
1212
if "_%B2_TOOLSET%_" == "_vc141_" call :Config_VC141
1313
if "_%B2_TOOLSET%_" == "_vc142_" call :Config_VC142
14+
if "_%B2_TOOLSET%_" == "_vc143_" call :Config_VC143
1415
if "_%B2_TOOLSET%_" == "_borland_" call :Config_BORLAND
1516
if "_%B2_TOOLSET%_" == "_como_" call :Config_COMO
1617
if "_%B2_TOOLSET%_" == "_gcc_" call :Config_GCC
@@ -137,6 +138,28 @@ set "B2_CXX_LINK=/link kernel32.lib advapi32.lib user32.lib"
137138
set "_known_=1"
138139
goto :eof
139140

141+
:Config_VC143
142+
if not defined CXX ( set "CXX=cl" )
143+
call vswhere_usability_wrapper.cmd
144+
REM Reset ERRORLEVEL since from now on it's all based on ENV vars
145+
ver > nul 2> nul
146+
if "_%B2_TOOLSET_ROOT%_" == "__" (
147+
if NOT "_%VS170COMNTOOLS%_" == "__" (
148+
set "B2_TOOLSET_ROOT=%VS170COMNTOOLS%..\..\VC\"
149+
))
150+
151+
if "_%B2_ARCH%_" == "__" set B2_ARCH=%PROCESSOR_ARCHITECTURE%
152+
set B2_BUILD_ARGS=%B2_BUILD_ARGS% %B2_ARCH%
153+
154+
REM return to current directory as vsdevcmd_end.bat switches to %USERPROFILE%\Source if it exists.
155+
pushd %CD%
156+
if "_%VSINSTALLDIR%_" == "__" call :Call_If_Exists "%B2_TOOLSET_ROOT%Auxiliary\Build\vcvarsall.bat" %B2_BUILD_ARGS%
157+
popd
158+
set "B2_CXX="%CXX%" /nologo /MP /MT /TP /Feb2 /wd4996 /O2 /GL /EHsc"
159+
set "B2_CXX_LINK=/link kernel32.lib advapi32.lib user32.lib"
160+
set "_known_=1"
161+
goto :eof
162+
140163
:Config_VCUNK
141164
if NOT "_%B2_TOOLSET%_" == "_vcunk_" goto Skip_VCUNK
142165
call vswhere_usability_wrapper.cmd

src/engine/guess_toolset.bat

+4
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ REM Let vswhere tell us where msvc is at, if available.
3333
call :Clear_Error
3434
call vswhere_usability_wrapper.cmd
3535
call :Clear_Error
36+
if NOT "_%VS170COMNTOOLS%_" == "__" (
37+
set "B2_TOOLSET=vc143"
38+
set "B2_TOOLSET_ROOT=%VS170COMNTOOLS%..\..\VC\"
39+
goto :eof)
3640
if NOT "_%VS160COMNTOOLS%_" == "__" (
3741
set "B2_TOOLSET=vc142"
3842
set "B2_TOOLSET_ROOT=%VS160COMNTOOLS%..\..\VC\"

src/engine/vswhere_usability_wrapper.cmd

+15-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ if errorlevel 1 goto :no-vswhere
1717
set VSWHERE_REQ=-requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64
1818
set VSWHERE_PRP=-property installationPath
1919

20-
REM Visual Studio Unknown Version, Beyond 2019
21-
set VSWHERE_LMT=-version "[17.0,18.0)"
20+
REM Visual Studio Unknown Version, Beyond 2022
21+
set VSWHERE_LMT=-version "[18.0,19.0)"
2222
set VSWHERE_PRERELEASE=-prerelease
2323
SET VSWHERE_ARGS=-latest -products * %VSWHERE_REQ% %VSWHERE_PRP% %VSWHERE_LMT% %VSWHERE_PRERELEASE%
2424
for /f "usebackq tokens=*" %%i in (`vswhere %VSWHERE_ARGS%`) do (
@@ -30,6 +30,19 @@ for /f "usebackq tokens=*" %%i in (`vswhere %VSWHERE_ARGS%`) do (
3030
exit /B 0
3131
)
3232

33+
REM Visual Studio 2022
34+
set VSWHERE_LMT=-version "[17.0,18.0)"
35+
set VSWHERE_PRERELEASE=-prerelease
36+
SET VSWHERE_ARGS=-latest -products * %VSWHERE_REQ% %VSWHERE_PRP% %VSWHERE_LMT% %VSWHERE_PRERELEASE%
37+
for /f "usebackq tokens=*" %%i in (`vswhere %VSWHERE_ARGS%`) do (
38+
endlocal
39+
echo Found with vswhere %%i
40+
@rem comment out setting VCINSTALLDIR for Boost.build
41+
@rem set "VCINSTALLDIR=%%i\VC\"
42+
set "VS170COMNTOOLS=%%i\Common7\Tools\"
43+
exit /B 0
44+
)
45+
3346
REM Visual Studio 2019 (16.X, toolset 14.2)
3447
set VSWHERE_LMT=-version "[16.0,17.0)"
3548
SET VSWHERE_ARGS=-latest -products * %VSWHERE_REQ% %VSWHERE_PRP% %VSWHERE_LMT% %VSWHERE_PRERELEASE%

src/tools/msvc.jam

+26-5
Original file line numberDiff line numberDiff line change
@@ -1113,7 +1113,15 @@ local rule generate-setup-cmd ( version : command : parent : options * : cpu : g
11131113
}
11141114
else
11151115
{
1116-
if [ MATCH "(14.2)" : $(version) ]
1116+
if [ MATCH "(14.3)" : $(version) ]
1117+
{
1118+
if $(.debug-configuration)
1119+
{
1120+
ECHO "notice: [generate-setup-cmd] $(version) is 14.3" ;
1121+
}
1122+
parent = [ path.native [ path.join $(parent) "..\\..\\..\\..\\..\\Auxiliary\\Build" ] ] ;
1123+
}
1124+
else if [ MATCH "(14.2)" : $(version) ]
11171125
{
11181126
if $(.debug-configuration)
11191127
{
@@ -1284,7 +1292,11 @@ local rule configure-really ( version ? : options * )
12841292
# version from the path.
12851293
# FIXME: We currently detect both Microsoft Visual Studio 9.0 and
12861294
# 9.0express as 9.0 here.
1287-
if [ MATCH "(MSVC\\\\14.2)" : $(command) ]
1295+
if [ MATCH "(MSVC\\\\14.3)" : $(command) ]
1296+
{
1297+
version = 14.3 ;
1298+
}
1299+
else if [ MATCH "(MSVC\\\\14.2)" : $(command) ]
12881300
{
12891301
version = 14.2 ;
12901302
}
@@ -1701,13 +1713,17 @@ local rule default-path ( version )
17011713
# And fortunately, forward slashes do also work in native Windows.
17021714
local vswhere = "$(root)/Microsoft Visual Studio/Installer/vswhere.exe" ;
17031715
# The check for $(root) is to avoid a segmentation fault if not found.
1704-
if $(version) in 14.1 14.2 default && $(root) && [ path.exists $(vswhere) ]
1716+
if $(version) in 14.1 14.2 14.3 default && $(root) && [ path.exists $(vswhere) ]
17051717
{
17061718
local req = "-requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64" ;
17071719
local prop = "-property installationPath" ;
17081720
local limit ;
17091721

1710-
if $(version) = 14.2 || $(version) = "default"
1722+
if $(version) = 14.3
1723+
{
1724+
limit = "-version \"[17.0,18.0)\" -prerelease" ;
1725+
}
1726+
else if $(version) = 14.2 || $(version) = "default"
17111727
{
17121728
limit = "-version \"[16.0,17.0)\"" ;
17131729
}
@@ -2138,7 +2154,7 @@ for local arch in [ MATCH "^\\.cpus-on-(.*)" : [ VARNAMES $(__name__) ] ]
21382154
armv7 armv7s ;
21392155

21402156
# Known toolset versions, in order of preference.
2141-
.known-versions = 14.2 14.1 14.0 12.0 11.0 10.0 10.0express 9.0 9.0express 8.0 8.0express 7.1
2157+
.known-versions = 14.3 14.2 14.1 14.0 12.0 11.0 10.0 10.0express 9.0 9.0express 8.0 8.0express 7.1
21422158
7.1toolkit 7.0 6.0 ;
21432159

21442160
# Version aliases.
@@ -2185,6 +2201,11 @@ for local arch in [ MATCH "^\\.cpus-on-(.*)" : [ VARNAMES $(__name__) ] ]
21852201
"Microsoft Visual Studio/2019/*/VC/Tools/MSVC/*/bin/Host*/*"
21862202
;
21872203
.version-14.2-env = VS160COMNTOOLS ProgramFiles ProgramFiles(x86) ;
2204+
.version-14.3-path =
2205+
"../../VC/Tools/MSVC/*/bin/Host*/*"
2206+
"Microsoft Visual Studio/2022/*/VC/Tools/MSVC/*/bin/Host*/*"
2207+
;
2208+
.version-14.3-env = VS170COMNTOOLS ProgramFiles ProgramFiles(x86) ;
21882209

21892210
# Auto-detect all the available msvc installations on the system.
21902211
auto-detect-toolset-versions ;

0 commit comments

Comments
 (0)