From: cournape Date: Thu, 19 Nov 2009 04:53:31 +0000 (+0000) Subject: ENH: factor host/target handling in separate function. X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=278c4de700d64d73efb3f7932d1f2867dde72e2f;p=scons.git ENH: factor host/target handling in separate function. git-svn-id: http://scons.tigris.org/svn/scons/trunk@4436 fdb21ef1-2011-0410-befe-b5e4ea1792b1 --- diff --git a/src/engine/SCons/Tool/MSCommon/vc.py b/src/engine/SCons/Tool/MSCommon/vc.py index 9b4efc6b..4facb53f 100644 --- a/src/engine/SCons/Tool/MSCommon/vc.py +++ b/src/engine/SCons/Tool/MSCommon/vc.py @@ -303,12 +303,7 @@ _TARGET_ARCH_TO_BAT_ARCH = { "i386": "x86", "amd64": "amd64"} -def msvc_setup_env(env): - debug('msvc_setup_env()') - - version = get_default_version(env) - env['MSVC_VERSION'] = version - +def get_host_target(env): host_platform = env.get('HOST_ARCH') if not host_platform: #host_platform = get_default_host_platform() @@ -317,6 +312,14 @@ def msvc_setup_env(env): if not target_platform: target_platform = host_platform + return host_platform, target_platform + +def msvc_setup_env(env): + debug('msvc_setup_env()') + + version = get_default_version(env) + env['MSVC_VERSION'] = version + msvc = InstalledVCMap.get(version) debug('msvc_setup_env: using specified MSVC version %s\n' % repr(version)) if not msvc: @@ -325,6 +328,7 @@ def msvc_setup_env(env): SCons.Warnings.warn(SCons.Warnings.VisualCMissingWarning, msg) return None + host_platform, target_platform = get_host_target(env) use_script = env.get('MSVC_USE_SCRIPT', True) if SCons.Util.is_String(use_script): debug('use_script 1 %s\n' % repr(use_script))