From e9835ea9f4d174b6da94f8e36dfcaa47b12bd922 Mon Sep 17 00:00:00 2001 From: Joseph Brill <48932340+jcbrill@users.noreply.github.com> Date: Mon, 15 Jun 2020 08:39:38 -0400 Subject: The cl.exe existence check for msvc 6.0 fails due to the case sensitivity of the filename ("cl.exe" and "CL.EXE"). First check vc_dir/bin/cl.exe and vc_dir/cl.exe for existence. Modify the vc_dir walk to check for existence under the directories rather than testing if cl.exe is in the file list. Existence test is not sensitive to file name case. --- SCons/Tool/MSCommon/vc.py | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/SCons/Tool/MSCommon/vc.py b/SCons/Tool/MSCommon/vc.py index 4ac87d1..70a19a8 100644 --- a/SCons/Tool/MSCommon/vc.py +++ b/SCons/Tool/MSCommon/vc.py @@ -628,10 +628,19 @@ def _check_cl_exists_in_vc_dir(env, vc_dir, msvc_version): return True elif 8 > ver_num >= 6: - # not sure about these versions so if a walk the VC dir (could be slow) - for root, _, files in os.walk(vc_dir): - if _CL_EXE_NAME in files: - debug(_CL_EXE_NAME + ' found %s' % os.path.join(root, _CL_EXE_NAME)) + # quick check for vc_dir/bin and vc_dir/ before walk + # need to check root as the walk only considers subdirectories + for cl_dir in ('bin', ''): + cl_path = os.path.join(vc_dir, cl_dir, _CL_EXE_NAME) + if os.path.exists(cl_path): + debug(_CL_EXE_NAME + ' found %s' % cl_path) + return True + # not in bin or root: must be in a subdirectory + for cl_root, cl_dirs, _ in os.walk(vc_dir): + for cl_dir in cl_dirs: + cl_path = os.path.join(cl_root, cl_dir, _CL_EXE_NAME) + if os.path.exists(cl_path): + debug(_CL_EXE_NAME + ' found %s' % cl_path) return True return False else: -- cgit v0.12