diff options
author | Daniel Moody <dmoody256@gmail.com> | 2019-01-09 10:07:21 -0600 |
---|---|---|
committer | Daniel Moody <dmoody256@gmail.com> | 2019-01-09 10:07:21 -0600 |
commit | 39bdae14fbee3f7c724ec64b38f117849cbebeda (patch) | |
tree | 447bcdc1fd5d589c66fd932166a53c3ad78482c9 | |
parent | a17c87b1b644acb37270d2282743d471c2aae549 (diff) | |
download | scons-git-39bdae14fbee3f7c724ec64b38f117849cbebeda.tar.gz |
added ability to get vc dir without env (assume host == target) and fixed test
-rw-r--r-- | src/engine/SCons/Tool/MSCommon/vc.py | 10 | ||||
-rw-r--r-- | test/CC/CCFLAGS.py | 4 |
2 files changed, 9 insertions, 5 deletions
diff --git a/src/engine/SCons/Tool/MSCommon/vc.py b/src/engine/SCons/Tool/MSCommon/vc.py index fccab88b2..168add5e9 100644 --- a/src/engine/SCons/Tool/MSCommon/vc.py +++ b/src/engine/SCons/Tool/MSCommon/vc.py @@ -350,8 +350,12 @@ __INSTALLED_VCS_RUN = None def _check_cl_exists_in_vc_dir(env, vc_dir, msvc_version): ver_num = float(get_msvc_version_numeric(msvc_version)) found_cl = False - (host_platform, target_platform,req_target_platform) = get_host_target(env) - + if env: + (host_platform, target_platform,req_target_platform) = get_host_target(env) + else: + host_platform = platform.machine().lower() + target_platform = host_platform + # check to see if the x86 or 64 bit compiler is in the bin dir if ver_num > 14: try: @@ -414,7 +418,7 @@ def cached_get_installed_vcs(env): return __INSTALLED_VCS_RUN -def get_installed_vcs(env): +def get_installed_vcs(env=None): installed_versions = [] for ver in _VCVER: debug('trying to find VC %s' % ver) diff --git a/test/CC/CCFLAGS.py b/test/CC/CCFLAGS.py index 967f8657a..a9db61f0f 100644 --- a/test/CC/CCFLAGS.py +++ b/test/CC/CCFLAGS.py @@ -29,6 +29,8 @@ import TestSCons _obj = TestSCons._obj +test = TestSCons.TestSCons() + if sys.platform == 'win32': import SCons.Tool.MSCommon as msc @@ -42,8 +44,6 @@ else: fooflags = '-DFOO' barflags = '-DBAR' -test = TestSCons.TestSCons() - test.write('SConstruct', """ foo = Environment(CCFLAGS = '%s') bar = Environment(CCFLAGS = '%s') |