ENH: factor host/target handling in separate function.
authorcournape <cournape@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Thu, 19 Nov 2009 04:53:31 +0000 (04:53 +0000)
committercournape <cournape@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Thu, 19 Nov 2009 04:53:31 +0000 (04:53 +0000)
git-svn-id: http://scons.tigris.org/svn/scons/trunk@4436 fdb21ef1-2011-0410-befe-b5e4ea1792b1

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

index 9b4efc6ba11dd880764a7007aa58de79a385c070..4facb53f90eec51d66c97d708df7c14298d67ab1 100644 (file)
@@ -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))