From 08c4b1810578f8b47dd697e4898eb5cd92dcfba3 Mon Sep 17 00:00:00 2001 From: cournape Date: Thu, 19 Nov 2009 05:01:22 +0000 Subject: [PATCH] ENH: use a pre-sorted list for MSVC versions to check. git-svn-id: http://scons.tigris.org/svn/scons/trunk@4448 fdb21ef1-2011-0410-befe-b5e4ea1792b1 --- src/engine/SCons/Tool/MSCommon/vc2.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/engine/SCons/Tool/MSCommon/vc2.py b/src/engine/SCons/Tool/MSCommon/vc2.py index 0d17bd78..48af5a31 100644 --- a/src/engine/SCons/Tool/MSCommon/vc2.py +++ b/src/engine/SCons/Tool/MSCommon/vc2.py @@ -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) -- 2.26.2