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/mslink.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/mslink.py')
-rw-r--r-- | src/engine/SCons/Tool/mslink.py | 32 |
1 files changed, 20 insertions, 12 deletions
diff --git a/src/engine/SCons/Tool/mslink.py b/src/engine/SCons/Tool/mslink.py index 5a8a729..9881286 100644 --- a/src/engine/SCons/Tool/mslink.py +++ b/src/engine/SCons/Tool/mslink.py @@ -163,21 +163,29 @@ def generate(env): env['REGSVRFLAGS'] = '/s ' env['REGSVRCOM'] = '$REGSVR $REGSVRFLAGS $TARGET' - 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) + try: + version = SCons.Tool.msvs.get_default_visualstudio_version(env) - # since other tools can set these, we just make sure that the - # relevant stuff from MSVS is in there somewhere. - env.PrependENVPath('INCLUDE', include_path) - env.PrependENVPath('LIB', lib_path) - env.PrependENVPath('PATH', exe_path) + 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 these, we just make sure that the + # relevant stuff from MSVS is in there somewhere. + env.PrependENVPath('INCLUDE', include_path) + env.PrependENVPath('LIB', lib_path) + env.PrependENVPath('PATH', exe_path) + except (SCons.Util.RegError, SCons.Errors.InternalError): + pass 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('link') else: # there's at least one version of MSVS installed. |