]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Enhance Arch check.
authorwuyizhong <wuyizhong@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 13 Jul 2006 10:47:11 +0000 (10:47 +0000)
committerwuyizhong <wuyizhong@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 13 Jul 2006 10:47:11 +0000 (10:47 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@975 6f19259b-4bc3-4df7-8a09-765794883524

Tools/Source/GenBuild/org/tianocore/build/GenBuildTask.java

index 1c97da282527634e1b486c76334ae9b9f555d0c2..ec2fd1ad2f167f17156bc8920d6fbba7876077a4 100644 (file)
@@ -16,6 +16,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 package org.tianocore.build;\r
 \r
 import java.io.File;\r
 package org.tianocore.build;\r
 \r
 import java.io.File;\r
+import java.util.ArrayList;\r
 import java.util.Hashtable;\r
 import java.util.Iterator;\r
 import java.util.LinkedHashSet;\r
 import java.util.Hashtable;\r
 import java.util.Iterator;\r
 import java.util.LinkedHashSet;\r
@@ -194,7 +195,29 @@ public class GenBuildTask extends Ant {
         // If single module : intersection MSA supported ARCHs and tools def!!\r
         // else, get arch from pass down\r
         //\r
         // If single module : intersection MSA supported ARCHs and tools def!!\r
         // else, get arch from pass down\r
         //\r
-        String[] archList = GlobalData.getToolChainInfo().getArchs();        \r
+        Set<String> archListSupByToolChain = new LinkedHashSet<String>(); \r
+        String[] archs = GlobalData.getToolChainInfo().getArchs(); \r
+        \r
+        for (int i = 0; i < archs.length; i ++) {\r
+            archListSupByToolChain.add(archs[i]);\r
+        }\r
+        \r
+        Set<String> archSet = new LinkedHashSet<String>();\r
+        \r
+        if ( getProject().getProperty("ARCH") != null) {\r
+            String[] fpdArchList = getProject().getProperty("ARCH").split(" ");\r
+            \r
+            for (int i = 0; i < fpdArchList.length; i++) {\r
+                if (archListSupByToolChain.contains(fpdArchList[i])) {\r
+                    archSet.add(fpdArchList[i]);\r
+                }\r
+            }\r
+        }\r
+        else {\r
+            archSet = archListSupByToolChain; \r
+        }\r
+  \r
+        String[] archList = archSet.toArray(new String[archSet.size()]);\r
         \r
         //\r
         // Judge if arch is all supported by current module. If not, throw Exception.\r
         \r
         //\r
         // Judge if arch is all supported by current module. If not, throw Exception.\r
@@ -209,6 +232,7 @@ public class GenBuildTask extends Ant {
         }\r
         \r
         for (int k = 0; k < archList.length; k++) {\r
         }\r
         \r
         for (int k = 0; k < archList.length; k++) {\r
+            \r
             getProject().setProperty("ARCH", archList[k]);\r
             \r
             FpdModuleIdentification fpdModuleId = new FpdModuleIdentification(moduleId, archList[k]);\r
             getProject().setProperty("ARCH", archList[k]);\r
             \r
             FpdModuleIdentification fpdModuleId = new FpdModuleIdentification(moduleId, archList[k]);\r