ENH: use a pre-sorted list for MSVC versions to check.
authorcournape <cournape@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Thu, 19 Nov 2009 05:01:22 +0000 (05:01 +0000)
committercournape <cournape@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Thu, 19 Nov 2009 05:01:22 +0000 (05:01 +0000)
git-svn-id: http://scons.tigris.org/svn/scons/trunk@4448 fdb21ef1-2011-0410-befe-b5e4ea1792b1

src/engine/SCons/Tool/MSCommon/vc2.py

index 0d17bd78c522198c491fe2e2a3ce4383204c35f8..48af5a3108aef6b7d709b6c420407db153b3818e 100644 (file)
@@ -76,8 +76,11 @@ def get_host_target(env):
     return (_ARCH_TO_CANONICAL[host_platform], 
             _ARCH_TO_CANONICAL[target_platform])
 
+_VCVER = ["10.0", "9.0", "8.0", "7.1", "7.0", "6.0"]
 
 _VCVER_TO_PRODUCT_DIR = {
+        '10.0': [
+            r'Microsoft\VisualStudio\10.0\Setup\VC\ProductDir'],
         '9.0': [
             r'Microsoft\VisualStudio\9.0\Setup\VC\ProductDir',
             r'Microsoft\VCExpress\9.0\Setup\VC\ProductDir'],
@@ -144,13 +147,12 @@ def find_batch_file(msvc_version):
 
 def get_installed_vcs():
     installed_versions = []
-    for ver in _VCVER_TO_PRODUCT_DIR.keys():
+    for ver in _VCVER:
         debug('trying to find VC %s' % ver)
         if find_vc_pdir(ver):
             debug('found VC %s' % ver)
             installed_versions.append(ver)
-    # Sort version to get the most recent first
-    return sorted(installed_versions)[::-1]
+    return installed_versions
 
 def script_env(script, args=None):
     stdout = common.get_output(script, args)