Skip to content

Commit ae5e63a

Browse files
committed
Add support for upcoming Visual Studio "15"
This allows building with Visual Studio "15", expected to be released in 2017. Tested with Visual Studio "15" Preview 3. The compiler itself is the same as with Visual Studio 2015 Update 3, but if only Visual Studio "15" is installed, the compiler could not be found.
1 parent 5f09d17 commit ae5e63a

File tree

4 files changed

+47
-5
lines changed

4 files changed

+47
-5
lines changed

src/engine/build.bat

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ ECHO ### You can specify the toolset as the argument, i.e.:
2828
ECHO ### .\build.bat msvc
2929
ECHO ###
3030
ECHO ### Toolsets supported by this script are: borland, como, gcc, gcc-nocygwin,
31-
ECHO ### intel-win32, metrowerks, mingw, msvc, vc7, vc8, vc9, vc10, vc11, vc12, vc14
31+
ECHO ### intel-win32, metrowerks, mingw, msvc, vc7, vc8, vc9, vc10, vc11, vc12, vc14, vc15
3232
ECHO ###
3333
call :Set_Error
3434
endlocal
@@ -100,6 +100,16 @@ call :Clear_Error
100100
call :Test_Empty %ProgramFiles%
101101
if not errorlevel 1 set ProgramFiles=C:\Program Files
102102

103+
call :Clear_Error
104+
if NOT "_%VS150COMNTOOLS%_" == "__" (
105+
set "BOOST_JAM_TOOLSET=vc15"
106+
set "BOOST_JAM_TOOLSET_ROOT=%VS150COMNTOOLS%..\..\VC\"
107+
goto :eof)
108+
call :Clear_Error
109+
if EXIST "%ProgramFiles%\Microsoft Visual Studio 15.0\VC\VCVARSALL.BAT" (
110+
set "BOOST_JAM_TOOLSET=vc15"
111+
set "BOOST_JAM_TOOLSET_ROOT=%ProgramFiles%\Microsoft Visual Studio 15.0\VC\"
112+
goto :eof)
103113
call :Clear_Error
104114
if NOT "_%VS140COMNTOOLS%_" == "__" (
105115
set "BOOST_JAM_TOOLSET=vc14"
@@ -446,6 +456,21 @@ set "BOOST_JAM_OPT_MKJAMBASE=/Febootstrap\mkjambase0"
446456
set "BOOST_JAM_OPT_YYACC=/Febootstrap\yyacc0"
447457
set "_known_=1"
448458
:Skip_VC14
459+
if NOT "_%BOOST_JAM_TOOLSET%_" == "_vc15_" goto Skip_VC15
460+
if NOT "_%VS150COMNTOOLS%_" == "__" (
461+
set "BOOST_JAM_TOOLSET_ROOT=%VS150COMNTOOLS%..\..\VC\"
462+
)
463+
if "_%VCINSTALLDIR%_" == "__" call :Call_If_Exists "%BOOST_JAM_TOOLSET_ROOT%VCVARSALL.BAT" %BOOST_JAM_ARGS%
464+
if NOT "_%BOOST_JAM_TOOLSET_ROOT%_" == "__" (
465+
if "_%VCINSTALLDIR%_" == "__" (
466+
set "PATH=%BOOST_JAM_TOOLSET_ROOT%bin;%PATH%"
467+
) )
468+
set "BOOST_JAM_CC=cl /nologo /RTC1 /Zi /MTd /Fobootstrap/ /Fdbootstrap/ -DNT -DYYDEBUG -wd4996 kernel32.lib advapi32.lib user32.lib"
469+
set "BOOST_JAM_OPT_JAM=/Febootstrap\jam0"
470+
set "BOOST_JAM_OPT_MKJAMBASE=/Febootstrap\mkjambase0"
471+
set "BOOST_JAM_OPT_YYACC=/Febootstrap\yyacc0"
472+
set "_known_=1"
473+
:Skip_VC15
449474
if NOT "_%BOOST_JAM_TOOLSET%_" == "_borland_" goto Skip_BORLAND
450475
if "_%BOOST_JAM_TOOLSET_ROOT%_" == "__" (
451476
call :Test_Path bcc32.exe )

src/engine/build.jam

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -394,12 +394,19 @@ toolset vc12 cl : /Fe /Fe /Fd /Fo : -D
394394
[ opt --debug : /MTd /DEBUG /Z7 /Od /Ob0 /wd4996 ]
395395
-I$(--python-include) -I$(--extra-include)
396396
: kernel32.lib advapi32.lib user32.lib $(--python-lib[1]) ;
397+
## Microsoft Visual C++ 2015
397398
toolset vc14 cl : /Fe /Fe /Fd /Fo : -D
398399
: /nologo
399400
[ opt --release : /GL /MT /O2 /Ob2 /Gy /GF /GA /wd4996 ]
400401
[ opt --debug : /MTd /DEBUG /Z7 /Od /Ob0 /wd4996 ]
401402
-I$(--python-include) -I$(--extra-include)
402403
: kernel32.lib advapi32.lib user32.lib $(--python-lib[1]) ;
404+
toolset vc15 cl : /Fe /Fe /Fd /Fo : -D
405+
: /nologo
406+
[ opt --release : /GL /MT /O2 /Ob2 /Gy /GF /GA /wd4996 ]
407+
[ opt --debug : /MTd /DEBUG /Z7 /Od /Ob0 /wd4996 ]
408+
-I$(--python-include) -I$(--extra-include)
409+
: kernel32.lib advapi32.lib user32.lib $(--python-lib[1]) ;
403410
## VMS/OpenVMS DEC C
404411
toolset vmsdecc cc : /OBJECT= : "/DEFINES=(" "," ")"
405412
: /STANDARD=VAXC /PREFIX_LIBRARY_ENTRIES=(ALL_ENTRIES)

src/tools/msvc.jam

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -907,7 +907,11 @@ local rule configure-really ( version ? : options * )
907907
# version from the path.
908908
# FIXME: We currently detect both Microsoft Visual Studio 9.0 and
909909
# 9.0express as 9.0 here.
910-
if [ MATCH "(Microsoft Visual Studio 14)" : $(command) ]
910+
if [ MATCH "(Microsoft Visual Studio 15)" : $(command) ]
911+
{
912+
version = 15.0 ;
913+
}
914+
else if [ MATCH "(Microsoft Visual Studio 14)" : $(command) ]
911915
{
912916
version = 14.0 ;
913917
}
@@ -1591,7 +1595,7 @@ if [ MATCH (--debug-configuration) : [ modules.peek : ARGV ] ]
15911595
armv7 armv7s ;
15921596

15931597
# Known toolset versions, in order of preference.
1594-
.known-versions = 14.0 12.0 11.0 10.0 10.0express 9.0 9.0express 8.0 8.0express 7.1
1598+
.known-versions = 15.0 14.0 12.0 11.0 10.0 10.0express 9.0 9.0express 8.0 8.0express 7.1
15951599
7.1toolkit 7.0 6.0 ;
15961600

15971601
# Version aliases.
@@ -1604,6 +1608,7 @@ if [ MATCH (--debug-configuration) : [ modules.peek : ARGV ] ]
16041608
.version-alias-11 = 11.0 ;
16051609
.version-alias-12 = 12.0 ;
16061610
.version-alias-14 = 14.0 ;
1611+
.version-alias-15 = 15.0 ;
16071612

16081613
# Names of registry keys containing the Visual C++ installation path (relative
16091614
# to "HKEY_LOCAL_MACHINE\SOFTWARE\\Microsoft").
@@ -1619,6 +1624,7 @@ if [ MATCH (--debug-configuration) : [ modules.peek : ARGV ] ]
16191624
.version-11.0-reg = "VisualStudio\\11.0\\Setup\\VC" ;
16201625
.version-12.0-reg = "VisualStudio\\12.0\\Setup\\VC" ;
16211626
.version-14.0-reg = "VisualStudio\\14.0\\Setup\\VC" ;
1627+
.version-15.0-reg = "VisualStudio\\15.0\\Setup\\VC" ;
16221628

16231629
# Visual C++ Toolkit 2003 does not store its installation path in the registry.
16241630
# The environment variable 'VCToolkitInstallDir' and the default installation

src/tools/msvc.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -676,7 +676,9 @@ def configure_really(version=None, options=[]):
676676
# version from the path.
677677
# FIXME: We currently detect both Microsoft Visual Studio 9.0 and
678678
# 9.0express as 9.0 here.
679-
if re.search("Microsoft Visual Studio 14", command):
679+
if re.search("Microsoft Visual Studio 15", command):
680+
version = '15.0'
681+
elif re.search("Microsoft Visual Studio 14", command):
680682
version = '14.0'
681683
elif re.search("Microsoft Visual Studio 12", command):
682684
version = '12.0'
@@ -1191,7 +1193,7 @@ def first(self):
11911193

11921194

11931195
# Known toolset versions, in order of preference.
1194-
_known_versions = ['14.0', '12.0', '11.0', '10.0', '10.0express', '9.0', '9.0express', '8.0', '8.0express', '7.1', '7.1toolkit', '7.0', '6.0']
1196+
_known_versions = ['15.0', '14.0', '12.0', '11.0', '10.0', '10.0express', '9.0', '9.0express', '8.0', '8.0express', '7.1', '7.1toolkit', '7.0', '6.0']
11951197

11961198
# Version aliases.
11971199
__version_alias_6 = '6.0'
@@ -1203,6 +1205,7 @@ def first(self):
12031205
__version_alias_11 = '11.0'
12041206
__version_alias_12 = '12.0'
12051207
__version_alias_14 = '14.0'
1208+
__version_alias_15 = '15.0'
12061209

12071210
# Names of registry keys containing the Visual C++ installation path (relative
12081211
# to "HKEY_LOCAL_MACHINE\SOFTWARE\\Microsoft").
@@ -1218,6 +1221,7 @@ def first(self):
12181221
__version_11_0_reg = "VisualStudio\\11.0\\Setup\\VC"
12191222
__version_12_0_reg = "VisualStudio\\12.0\\Setup\\VC"
12201223
__version_14_0_reg = "VisualStudio\\14.0\\Setup\\VC"
1224+
__version_15_0_reg = "VisualStudio\\15.0\\Setup\\VC"
12211225

12221226
# Visual C++ Toolkit 2003 does not store its installation path in the registry.
12231227
# The environment variable 'VCToolkitInstallDir' and the default installation

0 commit comments

Comments
 (0)