Skip to content

Commit a82278b

Browse files
committed
fix bfgroup#157: update detect vs2017+ scripts to v1.11.2
1 parent 468eb50 commit a82278b

9 files changed

+385
-287
lines changed

src/engine/config_toolset.bat

+2-2
Original file line numberDiff line numberDiff line change
@@ -165,9 +165,9 @@ if "_%BOOST_JAM_TOOLSET_ROOT%_" == "__" (
165165
if NOT "_%VS150COMNTOOLS%_" == "__" (
166166
set "BOOST_JAM_TOOLSET_ROOT=%VS150COMNTOOLS%..\..\VC\"
167167
))
168-
SET cl_path_cmd="%~dp0..\tools\vc141helper\cl_path.cmd"
168+
SET vsCOMhelper_cmd="%~dp0..\tools\vsCOMhelper\get_key_helper.cmd" "IsVcCompatible,VisualCppToolsVersionMinor=14.10" "InstallationPath"
169169
if "_%BOOST_JAM_TOOLSET_ROOT%_" == "__" (
170-
for /f "tokens=*" %%A in ('cmd /D /S /C "%cl_path_cmd% 14.10"') do if NOT errorlevel 1 if NOT "_%%A_" == "__" (
170+
for /f "tokens=*" %%A in ('cmd /D /S /C "%vsCOMhelper_cmd%"') do if NOT errorlevel 1 if NOT "_%%A_" == "__" (
171171
set "BOOST_JAM_TOOLSET_ROOT=%%A\VC\"))
172172

173173
REM vc1410 vsvarsall requires the architecture as a parameter.

src/engine/guess_toolset.bat

+14-4
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,21 @@ if NOT "_%VS150COMNTOOLS%_" == "__" (
3232
set "BOOST_JAM_TOOLSET=vc1410"
3333
set "BOOST_JAM_TOOLSET_ROOT=%VS150COMNTOOLS%..\..\VC\"
3434
goto :eof)
35-
SET cl_path_cmd="%~dp0..\tools\vc141helper\cl_path.cmd"
36-
for /f "tokens=*" %%A in ('cmd /D /S /C "%cl_path_cmd% 14.10"') do if NOT errorlevel 1 if NOT "_%%A_" == "__" (
37-
set "BOOST_JAM_TOOLSET=vc1410"
38-
set "BOOST_JAM_TOOLSET_ROOT=%%A\VC\"
35+
SET vsCOMhelper_cmd="%~dp0..\tools\vsCOMhelper\get_key_helper.cmd" IsVcCompatible InstallationPath
36+
for /f "tokens=*" %%A in ('cmd /D /S /C "%vsCOMhelper_cmd% InstallationPath"') do vsCOMhelper_2 %%A
37+
IF NOT DEFINED BOOST_JAM_TOOLSET goto :After_vsCOMhelper
38+
IF NOT DEFINED BOOST_JAM_TOOLSET_ROOT goto :After_vsCOMhelper
39+
goto :eof
40+
41+
:vsCOMhelper_2
42+
IF "_%1_"=="__" goto :eof
43+
set "BOOST_JAM_TOOLSET_ROOT=%1\VC\"
44+
for /f "tokens=*" %%A in ('cmd /D /S /C "%vsCOMhelper_cmd% VCToolsVersionCode"') do if NOT "_%%A_"="__" (
45+
set "BOOST_JAM_TOOLSET=%%A"
3946
goto :eof)
47+
goto :eof
48+
49+
:After_vsCOMhelper
4050
if EXIST "%VS_ProgramFiles%\Microsoft Visual Studio\2017\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" (
4151
set "BOOST_JAM_TOOLSET=vc1410"
4252
set "BOOST_JAM_TOOLSET_ROOT=%VS_ProgramFiles%\Microsoft Visual Studio\2017\Enterprise\VC\"

src/tools/msvc.jam

+2-2
Original file line numberDiff line numberDiff line change
@@ -711,8 +711,8 @@ local rule auto-detect-toolset-versions ( )
711711
if $(i) = 14.10
712712
{
713713
local file = [ path.make [ modules.binding $(__name__) ] ] ;
714-
local cl_path = [ path.native [ path.join [ path.parent $(file) ] vc141helper cl_path.cmd ] ] ;
715-
local shell_ret = [ SHELL "$(cl_path) 14.10 -PathToCompiler" ] ;
714+
local vsCOMhelper_path = [ path.native [ path.join [ path.parent $(file) ] vsCOMhelper get_key_helper.cmd ] ] ;
715+
local shell_ret = [ SHELL "\"$(vsCOMhelper_path)\" \"IsVcCompatible,VisualCppToolsVersionMinor=$(i)\" VisualCppTools" ] ;
716716
local cl_path = $(shell_ret:D) ;
717717
if $(cl_path)
718718
{

src/tools/vc141helper/GetCLPath.ps1

-36
This file was deleted.

src/tools/vc141helper/GetVS2017Configuration.cs

-234
This file was deleted.

src/tools/vc141helper/cl_path.cmd

-9
This file was deleted.

src/tools/vsCOMhelper/GetKey.ps1

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Copyright 2017 - Refael Ackermann
2+
# Distributed under MIT style license
3+
# See accompanying file LICENSE at https://github.com/node4good/windows-autoconf
4+
# version: 1.11.1
5+
6+
param (
7+
[Parameter(Mandatory=$false)]
8+
[string[]]$filters = "IsVcCompatible",
9+
[Parameter(Mandatory=$false)]
10+
[string[]]$keys = "VisualCppToolsCL"
11+
)
12+
if (-NOT (Test-Path 'Registry::HKEY_CLASSES_ROOT\CLSID\{177F0C4A-1CD3-4DE7-A32C-71DBBB9FA36D}')) { Exit 1 }
13+
Add-Type -Path GetVS2017Configuration.cs;
14+
$insts = [VisualStudioConfiguration.ComSurrogate]::QueryEx()
15+
foreach ($filter in $filters) {
16+
if ($filter -ne "*") {
17+
if ($filter -like "*=*") {
18+
$parts = $filter -Split "=";
19+
$filter = $parts[0];
20+
$criteria = $parts[1];
21+
$insts = $insts | where { $_.Get($filter) -eq $criteria }
22+
} else {
23+
$insts = $insts | where { $_.Get($filter) }
24+
}
25+
}
26+
}
27+
foreach ($key in $keys) {
28+
if ($key -eq "*") { $insts | echo } else { $insts | % { $_.Get($key) } }
29+
}

0 commit comments

Comments
 (0)