From c3ff6cf238ceb80959eb19f1c21fc7419526c869 Mon Sep 17 00:00:00 2001 From: stevenknight Date: Tue, 21 Feb 2006 05:55:52 +0000 Subject: [PATCH] Fix VS8 integration for use with Express. (Christian Maaser) Portability fix in msvs.py. git-svn-id: http://scons.tigris.org/svn/scons/trunk@1428 fdb21ef1-2011-0410-befe-b5e4ea1792b1 --- src/engine/SCons/Tool/msvc.py | 14 ++++++++------ src/engine/SCons/Tool/msvs.py | 2 +- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/engine/SCons/Tool/msvc.py b/src/engine/SCons/Tool/msvc.py index 8ea4b39d..80c5896c 100644 --- a/src/engine/SCons/Tool/msvc.py +++ b/src/engine/SCons/Tool/msvc.py @@ -229,9 +229,6 @@ def _parse_msvc8_overrides(version,platform,suite): # ToDo: Support for other destinations than Win32 path_dirs = path_dirs.replace('Win32|', '') dirs['PATH'] = path_dirs - - dirs['VCINSTALLDIR'] = os.getenv('VCInstallDir') - dirs['VSINSTALLDIR'] = os.getenv('VSInstallDir') else: # There are no default directories in the registry for VS8 Express :( raise SCons.Errors.InternalError, "Unable to find MSVC paths in the registry." @@ -268,7 +265,12 @@ def _get_msvc7_path(path, version, platform): if paths.has_key(key): return paths[key] else: - return '---Unknown Location %s---' % match.group() + # Now look in the global environment variables + envresult = os.getenv(key) + if not envresult is None: + return envresult + '\\' + else: + return '---Unknown Location %s---' % match.group() rv = [] for entry in p.split(os.pathsep): @@ -343,9 +345,9 @@ def get_msvc_path(env, path, version): platform = 'x86' if version_num >= 8.0: - return _get_msvc8_path(path, version, platform, suite) + return _get_msvc8_path(path, str(version_num), platform, suite) elif version_num >= 7.0: - return _get_msvc7_path(path, version, platform) + return _get_msvc7_path(path, str(version_num), platform) path = string.upper(path + ' Dirs') K = ('Software\\Microsoft\\Devstudio\\%s\\' + diff --git a/src/engine/SCons/Tool/msvs.py b/src/engine/SCons/Tool/msvs.py index f00aca97..e17dcfd8 100644 --- a/src/engine/SCons/Tool/msvs.py +++ b/src/engine/SCons/Tool/msvs.py @@ -739,7 +739,7 @@ class _GenerateV7DSP(_DSPGenerator): if len(sources) > 1: s = map(os.path.normpath, sources) cp = os.path.commonprefix(s) - if cp and s[0][len(cp)] == os.path.sep: + if cp and s[0][len(cp)] == os.sep: sources = map(lambda s, l=len(cp): s[l:], sources) commonprefix = cp -- 2.26.2