Commits

William Deegan committed c915d91

work in progress to support multiple TARGET_ARCH's

Comments (0)

Files changed (1)

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

         msg = "Unrecognized host architecture %s"
         raise ValueError(msg % repr(host_platform))
 
-    try:
-        target = _ARCH_TO_CANONICAL[target_platform.lower()]
-    except KeyError, e:
-        all_archs = str(_ARCH_TO_CANONICAL.keys())
-        raise ValueError("Unrecognized target architecture %s\n\tValid architectures: %s" % (target_platform, all_archs))
+
+    # Handle target_platform being a list to set preferred order
+    if isinstance(target_platform,types.StringTypes):
+        target_platform = [target_platform,]
+
+    target = []
+    for t in target_platform:
+        try:
+            target.append(_ARCH_TO_CANONICAL[target_platform.lower()])
+        except KeyError, e:
+            all_archs = str(_ARCH_TO_CANONICAL.keys())
+            raise ValueError("Unrecognized target architecture %s\n\tValid architectures: %s" % (target_platform, all_archs))
+
+    # Now add reasonable defaults
+    # If we're on a 64bit x86 platform then add 32 bit x86 as a reasonable default
+    # Assuming the user hasn't explicitly requested a target or targets.
+    if not req_target_platform and 
+#DEEGAN
 
     return (host, target,req_target_platform)
 
     # If the user hasn't specifically requested a TARGET_ARCH, and
     # The TARGET_ARCH is amd64 then also try 32 bits if there are no viable
     # 64 bit tools installed
-    try_target_archs = [target_platform]
+    try_target_archs = target_platform[:]
     if not req_target_platform and target_platform in ('amd64','x86_64'):
         try_target_archs.append('x86')