From 3c696250f53e857cb54293e90b9e8e10ef4d18b7 Mon Sep 17 00:00:00 2001 From: wuyizhong Date: Thu, 13 Jul 2006 10:47:11 +0000 Subject: [PATCH] Enhance Arch check. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@975 6f19259b-4bc3-4df7-8a09-765794883524 --- .../org/tianocore/build/GenBuildTask.java | 26 ++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/Tools/Source/GenBuild/org/tianocore/build/GenBuildTask.java b/Tools/Source/GenBuild/org/tianocore/build/GenBuildTask.java index 1c97da2825..ec2fd1ad2f 100644 --- a/Tools/Source/GenBuild/org/tianocore/build/GenBuildTask.java +++ b/Tools/Source/GenBuild/org/tianocore/build/GenBuildTask.java @@ -16,6 +16,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. package org.tianocore.build; import java.io.File; +import java.util.ArrayList; import java.util.Hashtable; import java.util.Iterator; import java.util.LinkedHashSet; @@ -194,7 +195,29 @@ public class GenBuildTask extends Ant { // If single module : intersection MSA supported ARCHs and tools def!! // else, get arch from pass down // - String[] archList = GlobalData.getToolChainInfo().getArchs(); + Set archListSupByToolChain = new LinkedHashSet(); + String[] archs = GlobalData.getToolChainInfo().getArchs(); + + for (int i = 0; i < archs.length; i ++) { + archListSupByToolChain.add(archs[i]); + } + + Set archSet = new LinkedHashSet(); + + if ( getProject().getProperty("ARCH") != null) { + String[] fpdArchList = getProject().getProperty("ARCH").split(" "); + + for (int i = 0; i < fpdArchList.length; i++) { + if (archListSupByToolChain.contains(fpdArchList[i])) { + archSet.add(fpdArchList[i]); + } + } + } + else { + archSet = archListSupByToolChain; + } + + String[] archList = archSet.toArray(new String[archSet.size()]); // // Judge if arch is all supported by current module. If not, throw Exception. @@ -209,6 +232,7 @@ public class GenBuildTask extends Ant { } for (int k = 0; k < archList.length; k++) { + getProject().setProperty("ARCH", archList[k]); FpdModuleIdentification fpdModuleId = new FpdModuleIdentification(moduleId, archList[k]); -- 2.39.2