From cb70dbeb5cadfe94b48ad0d97452811cc4e5bbfc Mon Sep 17 00:00:00 2001 From: Arkadiy Shapkin Date: Wed, 1 Feb 2017 22:13:49 +0300 Subject: [PATCH] Some fixes for VS2017 #157 Path autodetection to VS works only if it installed to default path --- src/engine/build.bat | 16 +++++++++++++--- src/engine/build.jam | 1 + src/tools/msvc.py | 2 +- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/engine/build.bat b/src/engine/build.bat index 2086f37a7..a63285c52 100644 --- a/src/engine/build.bat +++ b/src/engine/build.bat @@ -106,9 +106,19 @@ if NOT "_%VS150COMNTOOLS%_" == "__" ( set "BOOST_JAM_TOOLSET_ROOT=%VS150COMNTOOLS%..\..\VC\" goto :eof) call :Clear_Error -if EXIST "%ProgramFiles%\Microsoft Visual Studio 15.0\VC\VCVARSALL.BAT" ( +if EXIST "%ProgramFiles%\Microsoft Visual Studio\2017\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" ( set "BOOST_JAM_TOOLSET=vc15" - set "BOOST_JAM_TOOLSET_ROOT=%ProgramFiles%\Microsoft Visual Studio 15.0\VC\" + set "BOOST_JAM_TOOLSET_ROOT=%ProgramFiles%\Microsoft Visual Studio\2017\Enterprise\VC\" + goto :eof) +call :Clear_Error +if EXIST "%ProgramFiles%\Microsoft Visual Studio\2017\Professional\VC\Auxiliary\Build\vcvarsall.bat" ( + set "BOOST_JAM_TOOLSET=vc15" + set "BOOST_JAM_TOOLSET_ROOT=%ProgramFiles%\Microsoft Visual Studio\2017\Professional\VC\" + goto :eof) +call :Clear_Error +if EXIST "%ProgramFiles%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" ( + set "BOOST_JAM_TOOLSET=vc15" + set "BOOST_JAM_TOOLSET_ROOT=%ProgramFiles%\Microsoft Visual Studio\2017\Community\VC\" goto :eof) call :Clear_Error if NOT "_%VS140COMNTOOLS%_" == "__" ( @@ -460,7 +470,7 @@ 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 "_%VCINSTALLDIR%_" == "__" call :Call_If_Exists "%BOOST_JAM_TOOLSET_ROOT%Auxiliary\Build\vcvarsall.bat" %BOOST_JAM_ARGS% if NOT "_%BOOST_JAM_TOOLSET_ROOT%_" == "__" ( if "_%VCINSTALLDIR%_" == "__" ( set "PATH=%BOOST_JAM_TOOLSET_ROOT%bin;%PATH%" diff --git a/src/engine/build.jam b/src/engine/build.jam index e16b24085..59d0cb658 100644 --- a/src/engine/build.jam +++ b/src/engine/build.jam @@ -401,6 +401,7 @@ toolset vc14 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++ 2017 toolset vc15 cl : /Fe /Fe /Fd /Fo : -D : /nologo [ opt --release : /GL /MT /O2 /Ob2 /Gy /GF /GA /wd4996 ] diff --git a/src/tools/msvc.py b/src/tools/msvc.py index baa57e831..efd3a908a 100644 --- a/src/tools/msvc.py +++ b/src/tools/msvc.py @@ -772,7 +772,7 @@ 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 15", command): + if re.search("Microsoft Visual Studio[\/\\]2017", command): version = '15.0' elif re.search("Microsoft Visual Studio 14", command): version = '14.0'