diff options
author | Steven Knight <knight@baldmt.com> | 2003-06-08 13:22:57 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2003-06-08 13:22:57 (GMT) |
commit | 4d7ed00302f2f872f9719125b4fcb048e4ecb7ef (patch) | |
tree | 4afaba4669ddae8c3ce9972f79471d8387930e87 /src/engine/SCons/Tool/mslink.py | |
parent | 8fc3c77d320fb435cb9268d31c34a58b18a58b54 (diff) | |
download | SCons-4d7ed00302f2f872f9719125b4fcb048e4ecb7ef.zip SCons-4d7ed00302f2f872f9719125b4fcb048e4ecb7ef.tar.gz SCons-4d7ed00302f2f872f9719125b4fcb048e4ecb7ef.tar.bz2 |
Add MSVS Project file support. (Greg Spencer)
Diffstat (limited to 'src/engine/SCons/Tool/mslink.py')
-rw-r--r-- | src/engine/SCons/Tool/mslink.py | 34 |
1 files changed, 23 insertions, 11 deletions
diff --git a/src/engine/SCons/Tool/mslink.py b/src/engine/SCons/Tool/mslink.py index 8aa6f09..5a8a729 100644 --- a/src/engine/SCons/Tool/mslink.py +++ b/src/engine/SCons/Tool/mslink.py @@ -40,9 +40,9 @@ import SCons.Action import SCons.Defaults import SCons.Errors import SCons.Util -import msvc - -from SCons.Tool.msvc import get_msdev_paths +import SCons.Tool.msvs +import SCons.Tool.msvc +import SCons.Platform.win32 def pdbGenerator(env, target, source, for_signature): if target and env.has_key('PDB') and env['PDB']: @@ -73,7 +73,7 @@ def win32ShlinkSources(target, source, env, for_signature): return listCmd def win32LibEmitter(target, source, env): - msvc.validate_vars(env) + SCons.Tool.msvc.validate_vars(env) dll = env.FindIxes(target, "SHLIBPREFIX", "SHLIBSUFFIX") no_import_lib = env.get('no_import_lib', 0) @@ -107,7 +107,7 @@ def win32LibEmitter(target, source, env): return (target, source) def prog_emitter(target, source, env): - msvc.validate_vars(env) + SCons.Tool.msvc.validate_vars(env) if env.has_key('PDB') and env['PDB']: env.SideEffect(env['PDB'], target) @@ -159,14 +159,26 @@ def generate(env): env['WIN32EXPSUFFIX'] = '.exp' env['REGSVRACTION'] = regServerCheck - env['REGSVR'] = 'regsvr32' + env['REGSVR'] = os.path.join(SCons.Platform.win32.get_system_root(),'System32','regsvr32') env['REGSVRFLAGS'] = '/s ' env['REGSVRCOM'] = '$REGSVR $REGSVRFLAGS $TARGET' - if SCons.Util.can_read_reg: - include_path, lib_path, exe_path = get_msdev_paths() - env['ENV']['LIB'] = lib_path - env['ENV']['PATH'] = exe_path + 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) + + # 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) def exists(env): - return env.Detect('link') + if not SCons.Util.can_read_reg or not SCons.Tool.msvs.get_visualstudio_versions(): + return env.Detect('link') + else: + # there's at least one version of MSVS installed. + return True |