diff options
author | Daniel <dmoody256@gmail.com> | 2019-01-08 21:28:03 -0600 |
---|---|---|
committer | Daniel <dmoody256@gmail.com> | 2019-01-08 21:28:03 -0600 |
commit | dd4065f88fb4e00c83adb7d4b521636c8e33f779 (patch) | |
tree | d8c6e054d328ef6aefad5ff721a3566874e36a34 | |
parent | 8324cd2772fafb6f2268db22bcb026cbda2689f8 (diff) | |
download | scons-git-dd4065f88fb4e00c83adb7d4b521636c8e33f779.tar.gz |
make sure not to modify environment if just checking
-rw-r--r-- | src/engine/SCons/Tool/MSCommon/vc.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/engine/SCons/Tool/MSCommon/vc.py b/src/engine/SCons/Tool/MSCommon/vc.py index c79f393ac..cf776fcdd 100644 --- a/src/engine/SCons/Tool/MSCommon/vc.py +++ b/src/engine/SCons/Tool/MSCommon/vc.py @@ -366,7 +366,7 @@ def get_installed_vcs(env): debug('found VC %s' % ver) ver_num = float(get_msvc_version_numeric(ver)) # check to see if the x86 or 64 bit compiler is in the bin dir - if (ver_num > 14 and msvc_find_valid_batch_script(env,ver)): + if (ver_num > 14 and msvc_find_valid_batch_script(env,ver,False)): installed_versions.append(ver) elif (ver_num <= 14 and (os.path.exists(os.path.join(VC_DIR, r'bin\cl.exe')) @@ -453,7 +453,7 @@ def msvc_setup_env_once(env): msvc_setup_env(env) env["MSVC_SETUP_RUN"] = True -def msvc_find_valid_batch_script(env,version): +def msvc_find_valid_batch_script(env,version,modify_env=True): debug('vc.py:msvc_find_valid_batch_script()') # Find the host platform, target platform, and if present the requested # target platform @@ -479,7 +479,8 @@ def msvc_find_valid_batch_script(env,version): d = None for tp in try_target_archs: # Set to current arch. - env['TARGET_ARCH']=tp + if modify_env: + env['TARGET_ARCH']=tp debug("vc.py:msvc_find_valid_batch_script() trying target_platform:%s"%tp) host_target = (host_platform, tp) @@ -536,7 +537,7 @@ def msvc_find_valid_batch_script(env,version): # If we cannot find a viable installed compiler, reset the TARGET_ARCH # To it's initial value - if not d: + if not d and modify_env: env['TARGET_ARCH']=req_target_platform return d |