diff options
author | William Deegan <bill@baddogconsulting.com> | 2019-06-19 00:24:44 (GMT) |
---|---|---|
committer | William Deegan <bill@baddogconsulting.com> | 2019-06-19 00:24:44 (GMT) |
commit | 3ae19b9307c1602f303f3a4fe15792bd5a042f51 (patch) | |
tree | 294404d037dd00e18da8bacbc9182ecd8c840108 /src/engine | |
parent | 488d852d52c757bcf87cb7c1c9fdbdb0828a44ef (diff) | |
download | SCons-3ae19b9307c1602f303f3a4fe15792bd5a042f51.zip SCons-3ae19b9307c1602f303f3a4fe15792bd5a042f51.tar.gz SCons-3ae19b9307c1602f303f3a4fe15792bd5a042f51.tar.bz2 |
Switch from testing for directory value being false to -1 as "" evaluates to false
Diffstat (limited to 'src/engine')
-rw-r--r-- | src/engine/SCons/Tool/MSCommon/vc.py | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/engine/SCons/Tool/MSCommon/vc.py b/src/engine/SCons/Tool/MSCommon/vc.py index 1485b8c..d41d572 100644 --- a/src/engine/SCons/Tool/MSCommon/vc.py +++ b/src/engine/SCons/Tool/MSCommon/vc.py @@ -495,8 +495,10 @@ def _check_cl_exists_in_vc_dir(env, vc_dir, msvc_version): elif ver_num <= 14 and ver_num >= 8: - host_trgt_dir = _HOST_TARGET_TO_CL_DIR.get((host_platform, target_platform), None) - if not host_trgt_dir: + # Set default value to be -1 as "" which is the value for x86/x86 yields true when tested + # if not host_trgt_dir + host_trgt_dir = _HOST_TARGET_TO_CL_DIR.get((host_platform, target_platform), -1) + if host_trgt_dir == -1: debug('_check_cl_exists_in_vc_dir(): unsupported host/target platform combo') return False @@ -508,8 +510,11 @@ def _check_cl_exists_in_vc_dir(env, vc_dir, msvc_version): # older versions of visual studio only had x86 binaries, # so if the host platform is amd64, we need to check cross # compile options (x86 binary compiles some other target on a 64 bit os) - host_trgt_dir = _HOST_TARGET_TO_CL_DIR.get(('x86', target_platform), None) - if not host_trgt_dir: + + # Set default value to be -1 as "" which is the value for x86/x86 yields true when tested + # if not host_trgt_dir + host_trgt_dir = _HOST_TARGET_TO_CL_DIR.get(('x86', target_platform), -1) + if host_trgt_dir == -1: return False cl_path = os.path.join(vc_dir, 'bin', host_trgt_dir, _CL_EXE_NAME) |