diff options
author | William Deegan <bill@baddogconsulting.com> | 2017-08-08 02:20:29 (GMT) |
---|---|---|
committer | William Deegan <bill@baddogconsulting.com> | 2017-08-08 02:20:29 (GMT) |
commit | bc6d3c10beb08f217df7d9205e5fd678ca1338a7 (patch) | |
tree | d1d0897bef8abaccd2563f787e4893bfb589f348 /src/engine | |
parent | 64b17052e19da0466cd3b488be650d2ad27f2422 (diff) | |
download | SCons-bc6d3c10beb08f217df7d9205e5fd678ca1338a7.zip SCons-bc6d3c10beb08f217df7d9205e5fd678ca1338a7.tar.gz SCons-bc6d3c10beb08f217df7d9205e5fd678ca1338a7.tar.bz2 |
Fix VS2017 detection logic to fail properly when run on linux (posix) systems
Diffstat (limited to 'src/engine')
-rw-r--r-- | src/engine/SCons/Tool/MSCommon/vc.py | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/engine/SCons/Tool/MSCommon/vc.py b/src/engine/SCons/Tool/MSCommon/vc.py index c76afac..f8e72f5 100644 --- a/src/engine/SCons/Tool/MSCommon/vc.py +++ b/src/engine/SCons/Tool/MSCommon/vc.py @@ -242,10 +242,14 @@ def find_vc_pdir_vswhere(msvc_version): ) vswhere_cmd = [vswhere_path, '-version', msvc_version, '-property', 'installationPath'] - sp = subprocess.Popen(vswhere_cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) - vsdir, err = sp.communicate() - vc_pdir = os.path.join(vsdir.rstrip(), 'VC') - return vc_pdir + if os.path.exists(vswhere_path): + sp = subprocess.Popen(vswhere_cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + vsdir, err = sp.communicate() + vc_pdir = os.path.join(vsdir.rstrip(), 'VC') + return vc_pdir + else: + # No vswhere on system, no install info available + return None def find_vc_pdir(msvc_version): @@ -268,6 +272,9 @@ def find_vc_pdir(msvc_version): comps = None if not key: comps = find_vc_pdir_vswhere(msvc_version) + if not comps: + debug('find_vc_dir(): no VC found via vswhere for version {}'.format(repr(key))) + raise SCons.Util.WinError else: if common.is_win64(): try: |