diff options
author | Steven Knight <knight@baldmt.com> | 2003-06-14 07:04:50 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2003-06-14 07:04:50 (GMT) |
commit | 7414ccf0c3ddcdde49574a3a0e6f36c96908c549 (patch) | |
tree | c811f099b277f44a00e09339366a9a8f97b38df2 /src/engine/SCons/Tool/mslib.py | |
parent | ba5d88c5d08fc60d02eeeb65f85c6de9a95584c6 (diff) | |
download | SCons-7414ccf0c3ddcdde49574a3a0e6f36c96908c549.zip SCons-7414ccf0c3ddcdde49574a3a0e6f36c96908c549.tar.gz SCons-7414ccf0c3ddcdde49574a3a0e6f36c96908c549.tar.bz2 |
MSVS documentation, remove unnecessary exceptions, and restor escape() to its previous implementation. (Greg Spencer)
Diffstat (limited to 'src/engine/SCons/Tool/mslib.py')
-rw-r--r-- | src/engine/SCons/Tool/mslib.py | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/src/engine/SCons/Tool/mslib.py b/src/engine/SCons/Tool/mslib.py index 93a36cc..fd2484a 100644 --- a/src/engine/SCons/Tool/mslib.py +++ b/src/engine/SCons/Tool/mslib.py @@ -42,23 +42,31 @@ def generate(env): env['BUILDERS']['Library'] = SCons.Defaults.StaticLibrary env['BUILDERS']['StaticLibrary'] = SCons.Defaults.StaticLibrary - version = SCons.Tool.msvs.get_default_visualstudio_version(env) + try: + version = SCons.Tool.msvs.get_default_visualstudio_version(env) - if env.has_key('MSVS_IGNORE_IDE_PATHS') and env['MSVS_IGNORE_IDE_PATHS']: - include_path, lib_path, exe_path = SCons.Tool.msvc.get_msvc_default_paths(version) - else: - include_path, lib_path, exe_path = SCons.Tool.msvc.get_msvc_paths(version) + if env.has_key('MSVS_IGNORE_IDE_PATHS') and env['MSVS_IGNORE_IDE_PATHS']: + include_path, lib_path, exe_path = SCons.Tool.msvc.get_msvc_default_paths(version) + else: + include_path, lib_path, exe_path = SCons.Tool.msvc.get_msvc_paths(version) - # since other tools can set this, we just make sure that the - # relevant stuff from MSVS is in there somewhere. - env.PrependENVPath('PATH', exe_path) + # since other tools can set this, we just make sure that the + # relevant stuff from MSVS is in there somewhere. + env.PrependENVPath('PATH', exe_path) + except (SCons.Util.RegError, SCons.Errors.InternalError): + pass env['AR'] = 'lib' env['ARFLAGS'] = '/nologo' env['ARCOM'] = "${TEMPFILE('$AR $ARFLAGS /OUT:$TARGET $SOURCES')}" def exists(env): - if not SCons.Util.can_read_reg or not SCons.Tool.msvs.get_visualstudio_versions(): + try: + v = SCons.Tool.msvs.get_visualstudio_versions() + except (SCons.Util.RegError, SCons.Errors.InternalError): + pass + + if not v: return env.Detect('lib') else: # there's at least one version of MSVS installed. |