Skip to content

Commit

Permalink
Add support for upcoming Visual Studio "15"
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
MarcelRaad committed Jul 12, 2016
1 parent 5f09d17 commit ae5e63a
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 5 deletions.
27 changes: 26 additions & 1 deletion src/engine/build.bat
Expand Up @@ -28,7 +28,7 @@ ECHO ### You can specify the toolset as the argument, i.e.:
ECHO ### .\build.bat msvc
ECHO ###
ECHO ### Toolsets supported by this script are: borland, como, gcc, gcc-nocygwin,
ECHO ### intel-win32, metrowerks, mingw, msvc, vc7, vc8, vc9, vc10, vc11, vc12, vc14
ECHO ### intel-win32, metrowerks, mingw, msvc, vc7, vc8, vc9, vc10, vc11, vc12, vc14, vc15
ECHO ###
call :Set_Error
endlocal
Expand Down Expand Up @@ -100,6 +100,16 @@ call :Clear_Error
call :Test_Empty %ProgramFiles%
if not errorlevel 1 set ProgramFiles=C:\Program Files

call :Clear_Error
if NOT "_%VS150COMNTOOLS%_" == "__" (
set "BOOST_JAM_TOOLSET=vc15"
set "BOOST_JAM_TOOLSET_ROOT=%VS150COMNTOOLS%..\..\VC\"
goto :eof)
call :Clear_Error
if EXIST "%ProgramFiles%\Microsoft Visual Studio 15.0\VC\VCVARSALL.BAT" (
set "BOOST_JAM_TOOLSET=vc15"
set "BOOST_JAM_TOOLSET_ROOT=%ProgramFiles%\Microsoft Visual Studio 15.0\VC\"
goto :eof)
call :Clear_Error
if NOT "_%VS140COMNTOOLS%_" == "__" (
set "BOOST_JAM_TOOLSET=vc14"
Expand Down Expand Up @@ -446,6 +456,21 @@ set "BOOST_JAM_OPT_MKJAMBASE=/Febootstrap\mkjambase0"
set "BOOST_JAM_OPT_YYACC=/Febootstrap\yyacc0"
set "_known_=1"
:Skip_VC14
if NOT "_%BOOST_JAM_TOOLSET%_" == "_vc15_" goto Skip_VC15
if NOT "_%VS150COMNTOOLS%_" == "__" (
set "BOOST_JAM_TOOLSET_ROOT=%VS150COMNTOOLS%..\..\VC\"
)
if "_%VCINSTALLDIR%_" == "__" call :Call_If_Exists "%BOOST_JAM_TOOLSET_ROOT%VCVARSALL.BAT" %BOOST_JAM_ARGS%
if NOT "_%BOOST_JAM_TOOLSET_ROOT%_" == "__" (
if "_%VCINSTALLDIR%_" == "__" (
set "PATH=%BOOST_JAM_TOOLSET_ROOT%bin;%PATH%"
) )
set "BOOST_JAM_CC=cl /nologo /RTC1 /Zi /MTd /Fobootstrap/ /Fdbootstrap/ -DNT -DYYDEBUG -wd4996 kernel32.lib advapi32.lib user32.lib"
set "BOOST_JAM_OPT_JAM=/Febootstrap\jam0"
set "BOOST_JAM_OPT_MKJAMBASE=/Febootstrap\mkjambase0"
set "BOOST_JAM_OPT_YYACC=/Febootstrap\yyacc0"
set "_known_=1"
:Skip_VC15
if NOT "_%BOOST_JAM_TOOLSET%_" == "_borland_" goto Skip_BORLAND
if "_%BOOST_JAM_TOOLSET_ROOT%_" == "__" (
call :Test_Path bcc32.exe )
Expand Down
7 changes: 7 additions & 0 deletions src/engine/build.jam
Expand Up @@ -394,12 +394,19 @@ toolset vc12 cl : /Fe /Fe /Fd /Fo : -D
[ opt --debug : /MTd /DEBUG /Z7 /Od /Ob0 /wd4996 ]
-I$(--python-include) -I$(--extra-include)
: kernel32.lib advapi32.lib user32.lib $(--python-lib[1]) ;
## Microsoft Visual C++ 2015
toolset vc14 cl : /Fe /Fe /Fd /Fo : -D
: /nologo
[ opt --release : /GL /MT /O2 /Ob2 /Gy /GF /GA /wd4996 ]
[ opt --debug : /MTd /DEBUG /Z7 /Od /Ob0 /wd4996 ]
-I$(--python-include) -I$(--extra-include)
: kernel32.lib advapi32.lib user32.lib $(--python-lib[1]) ;
toolset vc15 cl : /Fe /Fe /Fd /Fo : -D
: /nologo
[ opt --release : /GL /MT /O2 /Ob2 /Gy /GF /GA /wd4996 ]
[ opt --debug : /MTd /DEBUG /Z7 /Od /Ob0 /wd4996 ]
-I$(--python-include) -I$(--extra-include)
: kernel32.lib advapi32.lib user32.lib $(--python-lib[1]) ;
## VMS/OpenVMS DEC C
toolset vmsdecc cc : /OBJECT= : "/DEFINES=(" "," ")"
: /STANDARD=VAXC /PREFIX_LIBRARY_ENTRIES=(ALL_ENTRIES)
Expand Down
10 changes: 8 additions & 2 deletions src/tools/msvc.jam
Expand Up @@ -907,7 +907,11 @@ local rule configure-really ( version ? : options * )
# version from the path.
# FIXME: We currently detect both Microsoft Visual Studio 9.0 and
# 9.0express as 9.0 here.
if [ MATCH "(Microsoft Visual Studio 14)" : $(command) ]
if [ MATCH "(Microsoft Visual Studio 15)" : $(command) ]
{
version = 15.0 ;
}
else if [ MATCH "(Microsoft Visual Studio 14)" : $(command) ]
{
version = 14.0 ;
}
Expand Down Expand Up @@ -1591,7 +1595,7 @@ if [ MATCH (--debug-configuration) : [ modules.peek : ARGV ] ]
armv7 armv7s ;

# Known toolset versions, in order of preference.
.known-versions = 14.0 12.0 11.0 10.0 10.0express 9.0 9.0express 8.0 8.0express 7.1
.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 ;

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

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

# Visual C++ Toolkit 2003 does not store its installation path in the registry.
# The environment variable 'VCToolkitInstallDir' and the default installation
Expand Down
8 changes: 6 additions & 2 deletions src/tools/msvc.py
Expand Up @@ -676,7 +676,9 @@ def configure_really(version=None, options=[]):
# version from the path.
# FIXME: We currently detect both Microsoft Visual Studio 9.0 and
# 9.0express as 9.0 here.
if re.search("Microsoft Visual Studio 14", command):
if re.search("Microsoft Visual Studio 15", command):
version = '15.0'
elif re.search("Microsoft Visual Studio 14", command):
version = '14.0'
elif re.search("Microsoft Visual Studio 12", command):
version = '12.0'
Expand Down Expand Up @@ -1191,7 +1193,7 @@ def first(self):


# Known toolset versions, in order of preference.
_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']
_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']

# Version aliases.
__version_alias_6 = '6.0'
Expand All @@ -1203,6 +1205,7 @@ def first(self):
__version_alias_11 = '11.0'
__version_alias_12 = '12.0'
__version_alias_14 = '14.0'
__version_alias_15 = '15.0'

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

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

0 comments on commit ae5e63a

Please sign in to comment.