summaryrefslogtreecommitdiffstats
path: root/src/engine
diff options
context:
space:
mode:
authorWilliam Deegan <bill@baddogconsulting.com>2017-08-08 02:20:29 (GMT)
committerWilliam Deegan <bill@baddogconsulting.com>2017-08-08 02:20:29 (GMT)
commitbc6d3c10beb08f217df7d9205e5fd678ca1338a7 (patch)
treed1d0897bef8abaccd2563f787e4893bfb589f348 /src/engine
parent64b17052e19da0466cd3b488be650d2ad27f2422 (diff)
downloadSCons-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.py15
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: