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
// If single module : intersection MSA supported ARCHs and tools def!!\r
// else, get arch from pass down\r
//\r
- String[] archList = new String[0];\r
- if ( getProject().getProperty("ARCH") != null ) {\r
- archList = getProject().getProperty("ARCH").split(" ");\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
- archList = GlobalData.getToolChainInfo().getArchs();\r
+ archSet = archListSupByToolChain; \r
}\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
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
//\r
// Whether the module is built before\r
//\r
- if (GlobalData.isModuleBuilt(fpdModuleId)) {\r
- return ;\r
+ if ((moduleId.isLibrary() == false && GlobalData.hasFpdModuleSA(fpdModuleId) == false) \r
+ || GlobalData.isModuleBuilt(fpdModuleId)) {\r
+ return;\r
}\r
else {\r
GlobalData.registerBuiltModule(fpdModuleId);\r