summaryrefslogtreecommitdiff
path: root/engine/SCons/Tool/MSCommon
diff options
context:
space:
mode:
Diffstat (limited to 'engine/SCons/Tool/MSCommon')
-rw-r--r--engine/SCons/Tool/MSCommon/__init__.py4
-rw-r--r--engine/SCons/Tool/MSCommon/arch.py4
-rw-r--r--engine/SCons/Tool/MSCommon/common.py35
-rw-r--r--engine/SCons/Tool/MSCommon/netframework.py7
-rw-r--r--engine/SCons/Tool/MSCommon/sdk.py34
-rw-r--r--engine/SCons/Tool/MSCommon/vc.py8
-rw-r--r--engine/SCons/Tool/MSCommon/vs.py12
7 files changed, 24 insertions, 80 deletions
diff --git a/engine/SCons/Tool/MSCommon/__init__.py b/engine/SCons/Tool/MSCommon/__init__.py
index 6340a30..8e72fea 100644
--- a/engine/SCons/Tool/MSCommon/__init__.py
+++ b/engine/SCons/Tool/MSCommon/__init__.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2001 - 2015 The SCons Foundation
+# Copyright (c) 2001 - 2016 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -21,7 +21,7 @@
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Tool/MSCommon/__init__.py rel_2.4.1:3453:73fefd3ea0b0 2015/11/09 03:25:05 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/MSCommon/__init__.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
__doc__ = """
Common functions for Microsoft Visual Studio and Visual C/C++.
diff --git a/engine/SCons/Tool/MSCommon/arch.py b/engine/SCons/Tool/MSCommon/arch.py
index 8047215..f7d28da 100644
--- a/engine/SCons/Tool/MSCommon/arch.py
+++ b/engine/SCons/Tool/MSCommon/arch.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2001 - 2015 The SCons Foundation
+# Copyright (c) 2001 - 2016 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -21,7 +21,7 @@
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Tool/MSCommon/arch.py rel_2.4.1:3453:73fefd3ea0b0 2015/11/09 03:25:05 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/MSCommon/arch.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
__doc__ = """Module to define supported Windows chip architectures.
"""
diff --git a/engine/SCons/Tool/MSCommon/common.py b/engine/SCons/Tool/MSCommon/common.py
index a7bc407..59296c2 100644
--- a/engine/SCons/Tool/MSCommon/common.py
+++ b/engine/SCons/Tool/MSCommon/common.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2001 - 2015 The SCons Foundation
+# Copyright (c) 2001 - 2016 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -21,7 +21,7 @@
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Tool/MSCommon/common.py rel_2.4.1:3453:73fefd3ea0b0 2015/11/09 03:25:05 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/MSCommon/common.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
__doc__ = """
Common helper functions for working with the Microsoft tool chain.
@@ -93,7 +93,7 @@ def has_reg(value):
try:
SCons.Util.RegOpenKeyEx(SCons.Util.HKEY_LOCAL_MACHINE, value)
ret = True
- except WindowsError:
+ except SCons.Util.WinError:
ret = False
return ret
@@ -180,7 +180,7 @@ def get_output(vcbat, args = None, env = None):
stdout = popen.stdout.read()
stderr = popen.stderr.read()
- # Extra debug logic, uncomment if necessar
+ # Extra debug logic, uncomment if necessary
# debug('get_output():stdout:%s'%stdout)
# debug('get_output():stderr:%s'%stderr)
@@ -226,33 +226,6 @@ def parse_output(output, keep = ("INCLUDE", "LIB", "LIBPATH", "PATH")):
return dkeep
-# TODO(sgk): unused
-def output_to_dict(output):
- """Given an output string, parse it to find env variables.
-
- Return a dict where keys are variables names, and values their content"""
- envlinem = re.compile(r'^([a-zA-z0-9]+)=([\S\s]*)$')
- parsedenv = {}
- for line in output.splitlines():
- m = envlinem.match(line)
- if m:
- parsedenv[m.group(1)] = m.group(2)
- return parsedenv
-
-# TODO(sgk): unused
-def get_new(l1, l2):
- """Given two list l1 and l2, return the items in l2 which are not in l1.
- Order is maintained."""
-
- # We don't try to be smart: lists are small, and this is not the bottleneck
- # is any case
- new = []
- for i in l2:
- if i not in l1:
- new.append(i)
-
- return new
-
# Local Variables:
# tab-width:4
# indent-tabs-mode:nil
diff --git a/engine/SCons/Tool/MSCommon/netframework.py b/engine/SCons/Tool/MSCommon/netframework.py
index 6062e11..935a8a5 100644
--- a/engine/SCons/Tool/MSCommon/netframework.py
+++ b/engine/SCons/Tool/MSCommon/netframework.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2001 - 2015 The SCons Foundation
+# Copyright (c) 2001 - 2016 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -20,13 +20,14 @@
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-__revision__ = "src/engine/SCons/Tool/MSCommon/netframework.py rel_2.4.1:3453:73fefd3ea0b0 2015/11/09 03:25:05 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/MSCommon/netframework.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
__doc__ = """
"""
import os
import re
+import SCons.Util
from common import read_reg, debug
@@ -40,7 +41,7 @@ def find_framework_root():
try:
froot = read_reg(_FRAMEWORKDIR_HKEY_ROOT)
debug("Found framework install root in registry: %s" % froot)
- except WindowsError, e:
+ except SCons.Util.WinError, e:
debug("Could not read reg key %s" % _FRAMEWORKDIR_HKEY_ROOT)
return None
diff --git a/engine/SCons/Tool/MSCommon/sdk.py b/engine/SCons/Tool/MSCommon/sdk.py
index 1b605b9..601f4f8 100644
--- a/engine/SCons/Tool/MSCommon/sdk.py
+++ b/engine/SCons/Tool/MSCommon/sdk.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2001 - 2015 The SCons Foundation
+# Copyright (c) 2001 - 2016 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -21,7 +21,7 @@
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-__revision__ = "src/engine/SCons/Tool/MSCommon/sdk.py rel_2.4.1:3453:73fefd3ea0b0 2015/11/09 03:25:05 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/MSCommon/sdk.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
__doc__ = """Module to detect the Platform/Windows SDK
@@ -80,7 +80,7 @@ class SDKDefinition(object):
try:
sdk_dir = common.read_reg(hkey)
- except WindowsError, e:
+ except SCons.Util.WinError, e:
debug('find_sdk_dir(): no SDK registry key %s' % repr(hkey))
return None
@@ -168,7 +168,7 @@ SDK70VCSetupScripts = { 'x86' : r'bin\vcvars32.bat',
#
# The first SDK found in the list is the one used by default if there
# are multiple SDKs installed. Barring good reasons to the contrary,
-# this means we should list SDKs with from most recent to oldest.
+# this means we should list SDKs from most recent to oldest.
#
# If you update this list, update the documentation in Tool/mssdk.xml.
SupportedSDKList = [
@@ -306,29 +306,6 @@ def set_sdk_by_directory(env, sdk_dir):
for variable, directory in env_tuple_list:
env.PrependENVPath(variable, directory)
-
-# TODO(sgk): currently unused; remove?
-def get_cur_sdk_dir_from_reg():
- """Try to find the platform sdk directory from the registry.
-
- Return None if failed or the directory does not exist"""
- if not SCons.Util.can_read_reg:
- debug('SCons cannot read registry')
- return None
-
- try:
- val = common.read_reg(_CURINSTALLED_SDK_HKEY_ROOT)
- debug("Found current sdk dir in registry: %s" % val)
- except WindowsError, e:
- debug("Did not find current sdk in registry")
- return None
-
- if not os.path.exists(val):
- debug("Current sdk dir %s not on fs" % val)
- return None
-
- return val
-
def get_sdk_by_version(mssdk):
if mssdk not in SupportedSDKMap:
msg = "SDK version %s is not supported" % repr(mssdk)
@@ -343,9 +320,6 @@ def get_default_sdk():
return None
return InstalledSDKList[0]
-
-
-
def mssdk_setup_env(env):
debug('sdk.py:mssdk_setup_env()')
if 'MSSDK_DIR' in env:
diff --git a/engine/SCons/Tool/MSCommon/vc.py b/engine/SCons/Tool/MSCommon/vc.py
index 7f12408..baf859a 100644
--- a/engine/SCons/Tool/MSCommon/vc.py
+++ b/engine/SCons/Tool/MSCommon/vc.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2001 - 2015 The SCons Foundation
+# Copyright (c) 2001 - 2016 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -30,7 +30,7 @@
# * test on 64 bits XP + VS 2005 (and VS 6 if possible)
# * SDK
# * Assembly
-__revision__ = "src/engine/SCons/Tool/MSCommon/vc.py rel_2.4.1:3453:73fefd3ea0b0 2015/11/09 03:25:05 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/MSCommon/vc.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
__doc__ = """Module for Visual C/C++ detection and configuration.
"""
@@ -244,13 +244,13 @@ def find_vc_pdir(msvc_version):
try:
# ordinally at win64, try Wow6432Node first.
comps = common.read_reg(root + 'Wow6432Node\\' + key, hkroot)
- except WindowsError, e:
+ except SCons.Util.WinError, e:
# at Microsoft Visual Studio for Python 2.7, value is not in Wow6432Node
pass
if not comps:
# not Win64, or Microsoft Visual Studio for Python 2.7
comps = common.read_reg(root + key, hkroot)
- except WindowsError, e:
+ except SCons.Util.WinError, e:
debug('find_vc_dir(): no VC registry key %s' % repr(key))
else:
debug('find_vc_dir(): found VC in registry: %s' % comps)
diff --git a/engine/SCons/Tool/MSCommon/vs.py b/engine/SCons/Tool/MSCommon/vs.py
index 86cd3a4..82b989d 100644
--- a/engine/SCons/Tool/MSCommon/vs.py
+++ b/engine/SCons/Tool/MSCommon/vs.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2001 - 2015 The SCons Foundation
+# Copyright (c) 2001 - 2016 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -21,7 +21,7 @@
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Tool/MSCommon/vs.py rel_2.4.1:3453:73fefd3ea0b0 2015/11/09 03:25:05 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/MSCommon/vs.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
__doc__ = """Module to detect Visual Studio and/or Visual C/C++
"""
@@ -52,8 +52,6 @@ class VisualStudio(object):
self.__dict__.update(kw)
self._cache = {}
- #
-
def find_batch_file(self):
vs_dir = self.get_vs_dir()
if not vs_dir:
@@ -85,7 +83,7 @@ class VisualStudio(object):
key = root + key
try:
comps = read_reg(key)
- except WindowsError, e:
+ except SCons.Util.WinError, e:
debug('find_vs_dir_by_reg(): no VS registry key %s' % repr(key))
else:
debug('find_vs_dir_by_reg(): found VS in registry: %s' % comps)
@@ -116,8 +114,6 @@ class VisualStudio(object):
return None
return executable
- #
-
def get_batch_file(self):
try:
return self._cache['batch_file']
@@ -471,7 +467,7 @@ def get_default_version(env):
"""Returns the default version string to use for MSVS.
If no version was requested by the user through the MSVS environment
- variable, query all the available the visual studios through
+ variable, query all the available visual studios through
get_installed_visual_studios, and take the highest one.
Return