diff options
Diffstat (limited to 'src/engine/SCons/Tool/mslib.py')
-rw-r--r-- | src/engine/SCons/Tool/mslib.py | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/src/engine/SCons/Tool/mslib.py b/src/engine/SCons/Tool/mslib.py index 4180e05..93a36cc 100644 --- a/src/engine/SCons/Tool/mslib.py +++ b/src/engine/SCons/Tool/mslib.py @@ -34,15 +34,32 @@ selection method. __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" import SCons.Defaults +import SCons.Tool.msvs +import SCons.Tool.msvc def generate(env): """Add Builders and construction variables for lib to an Environment.""" env['BUILDERS']['Library'] = SCons.Defaults.StaticLibrary env['BUILDERS']['StaticLibrary'] = SCons.Defaults.StaticLibrary - + + 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 this, we just make sure that the + # relevant stuff from MSVS is in there somewhere. + env.PrependENVPath('PATH', exe_path) + env['AR'] = 'lib' env['ARFLAGS'] = '/nologo' env['ARCOM'] = "${TEMPFILE('$AR $ARFLAGS /OUT:$TARGET $SOURCES')}" def exists(env): - return env.Detect('lib') + if not SCons.Util.can_read_reg or not SCons.Tool.msvs.get_visualstudio_versions(): + return env.Detect('lib') + else: + # there's at least one version of MSVS installed. + return True |