summaryrefslogtreecommitdiffstats
path: root/src/engine/SCons/Tool
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2003-11-18 07:10:57 (GMT)
committerSteven Knight <knight@baldmt.com>2003-11-18 07:10:57 (GMT)
commitd0a974d767a1bb4a3947020c019d625a11e0af19 (patch)
tree2852b82f577251e2af04c8bb3a335b0ca467e3b5 /src/engine/SCons/Tool
parent921722a590e38747ab92e91f8d048b6a63345b9e (diff)
downloadSCons-d0a974d767a1bb4a3947020c019d625a11e0af19.zip
SCons-d0a974d767a1bb4a3947020c019d625a11e0af19.tar.gz
SCons-d0a974d767a1bb4a3947020c019d625a11e0af19.tar.bz2
Ensure that the ENV values are all strings. (Anthony Roach)
Diffstat (limited to 'src/engine/SCons/Tool')
-rw-r--r--src/engine/SCons/Tool/msvc.py45
-rw-r--r--src/engine/SCons/Tool/msvs.py10
2 files changed, 37 insertions, 18 deletions
diff --git a/src/engine/SCons/Tool/msvc.py b/src/engine/SCons/Tool/msvc.py
index 2a067b9..f7ec5e4 100644
--- a/src/engine/SCons/Tool/msvc.py
+++ b/src/engine/SCons/Tool/msvc.py
@@ -261,29 +261,38 @@ def get_msvc_paths(version=None):
lib_path = ''
include_path = ''
- if not version and not SCons.Util.can_read_reg:
- version = '6.0'
-
- try:
- if not version:
- version = SCons.Tool.msvs.get_visualstudio_versions()[0] #use highest version
+ if not version:
+ versions = SCons.Tool.msvs.get_visualstudio_versions()
+ if versions:
+ version = versions[0] #use highest version by default
+ else:
+ version = '6.0'
+ # Some of the configured directories only
+ # appear if the user changes them from the default.
+ # Therefore, we'll see if we can get the path to the MSDev
+ # base installation from the registry and deduce the default
+ # directories.
+ if float(version) >= 7.0:
+ defpaths = _get_msvc7_default_paths(version)
+ else:
+ defpaths = _get_msvc6_default_paths(version)
+
+ try:
include_path = get_msvc_path("include", version)
+ except (SCons.Util.RegError, SCons.Errors.InternalError):
+ include_path = defpaths[0]
+
+ try:
lib_path = get_msvc_path("lib", version)
- exe_path = get_msvc_path("path", version)
+ except (SCons.Util.RegError, SCons.Errors.InternalError):
+ lib_path = defpaths[1]
+ try:
+ exe_path = get_msvc_path("path", version)
except (SCons.Util.RegError, SCons.Errors.InternalError):
- # Could not get all the configured directories from the
- # registry. However, some of the configured directories only
- # appear if the user changes them from the default.
- # Therefore, we'll see if we can get the path to the MSDev
- # base installation from the registry and deduce the default
- # directories.
- if float(version) >= 7.0:
- return _get_msvc7_default_paths(version)
- else:
- return _get_msvc6_default_paths(version)
-
+ exe_path = defpaths[2]
+
return (include_path, lib_path, exe_path)
def get_msvc_default_paths(version = None):
diff --git a/src/engine/SCons/Tool/msvs.py b/src/engine/SCons/Tool/msvs.py
index 949793a..ee860e3 100644
--- a/src/engine/SCons/Tool/msvs.py
+++ b/src/engine/SCons/Tool/msvs.py
@@ -787,6 +787,16 @@ def get_visualstudio_versions():
if not L:
return []
+ # This is a hack to get around the fact that certain Visual Studio
+ # patches place a "6.1" version in the registry, which does not have
+ # any of the keys we need to find include paths, install directories,
+ # etc. Therefore we ignore it if it is there, since it throws all
+ # other logic off.
+ try:
+ L.remove("6.1")
+ except ValueError:
+ pass
+
L.sort()
L.reverse()