diff options
author | Steven Knight <knight@baldmt.com> | 2004-05-08 23:00:41 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2004-05-08 23:00:41 (GMT) |
commit | 4ef08f4ff1914f6a8cf79fde2c105753885a8bfd (patch) | |
tree | c5dabe3f08e703324e118b91017875b6c22d4168 /src | |
parent | f424fc07e9aed44d3f5df0a14d4b44081c806ff1 (diff) | |
download | SCons-4ef08f4ff1914f6a8cf79fde2c105753885a8bfd.zip SCons-4ef08f4ff1914f6a8cf79fde2c105753885a8bfd.tar.gz SCons-4ef08f4ff1914f6a8cf79fde2c105753885a8bfd.tar.bz2 |
Better midl (Visual Studio MIDL compiler) Tool detection. (Anthony Roach)
Diffstat (limited to 'src')
-rw-r--r-- | src/CHANGES.txt | 3 | ||||
-rw-r--r-- | src/engine/SCons/Tool/midl.py | 9 | ||||
-rw-r--r-- | src/engine/SCons/Tool/mslink.py | 11 | ||||
-rw-r--r-- | src/engine/SCons/Tool/msvc.py | 12 | ||||
-rw-r--r-- | src/engine/SCons/Tool/msvs.py | 10 |
5 files changed, 28 insertions, 17 deletions
diff --git a/src/CHANGES.txt b/src/CHANGES.txt index 3d3d4ce..215937a 100644 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -127,6 +127,9 @@ RELEASE 0.96 - XXX - Fix use of the --implicit-cache option with timestamp signatures. + - If Visual Studio is installed, assume the C/C++ compiler, the linker + and the MIDL compiler that comes with it are available, too. + From sam th: - Allow SConf.CheckLib() to search a list of libraries, like the diff --git a/src/engine/SCons/Tool/midl.py b/src/engine/SCons/Tool/midl.py index 2efabcc..d02f23a 100644 --- a/src/engine/SCons/Tool/midl.py +++ b/src/engine/SCons/Tool/midl.py @@ -38,6 +38,7 @@ import os.path import SCons.Defaults import SCons.Scanner.IDL import SCons.Util +import SCons.Tool.msvs def midl_emitter(target, source, env): """Produces a list of outputs from the MIDL compiler""" @@ -69,4 +70,10 @@ def generate(env): env['BUILDERS']['TypeLibrary'] = midl_builder def exists(env): - return env.Detect('midl') + if SCons.Tool.msvs.is_msvs_installed(): + # there's at least one version of MSVS installed, which comes with midl: + return 1 + else: + return env.Detect('midl') + + diff --git a/src/engine/SCons/Tool/mslink.py b/src/engine/SCons/Tool/mslink.py index 7e32e60..5ff8a01 100644 --- a/src/engine/SCons/Tool/mslink.py +++ b/src/engine/SCons/Tool/mslink.py @@ -180,13 +180,8 @@ def generate(env): pass def exists(env): - try: - v = SCons.Tool.msvs.get_visualstudio_versions() - except (SCons.Util.RegError, SCons.Errors.InternalError): - pass - - if not v: - return env.Detect('link') - else: + if SCons.Tool.msvs.is_msvs_installed(): # there's at least one version of MSVS installed. return 1 + else: + return env.Detect('link') diff --git a/src/engine/SCons/Tool/msvc.py b/src/engine/SCons/Tool/msvc.py index 1caa4db..3d49802 100644 --- a/src/engine/SCons/Tool/msvc.py +++ b/src/engine/SCons/Tool/msvc.py @@ -478,13 +478,9 @@ def generate(env): env['BUILDERS']['PCH'] = pch_builder def exists(env): - try: - v = SCons.Tool.msvs.get_visualstudio_versions() - except (SCons.Util.RegError, SCons.Errors.InternalError): - pass - - if not v: - return env.Detect('cl') - else: + if SCons.Tool.msvs.is_msvs_installed(): # there's at least one version of MSVS installed. return 1 + else: + return env.Detect('cl') + diff --git a/src/engine/SCons/Tool/msvs.py b/src/engine/SCons/Tool/msvs.py index 10ab42a..06f850e 100644 --- a/src/engine/SCons/Tool/msvs.py +++ b/src/engine/SCons/Tool/msvs.py @@ -846,6 +846,16 @@ def get_visualstudio_versions(): return L +def is_msvs_installed(): + """ + Check the registry for an installed visual studio. + """ + try: + v = SCons.Tool.msvs.get_visualstudio_versions() + return v + except (SCons.Util.RegError, SCons.Errors.InternalError): + return 0 + def get_msvs_install_dirs(version = None): """ Get installed locations for various msvc-related products, like the .NET SDK |