X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=Tools%2FJava%2FSource%2FGenBuild%2Forg%2Ftianocore%2Fbuild%2Ffpd%2FFpdParserTask.java;h=719359af596d6ceff2cbe6260386744f60a12b4b;hp=86fb256e95afff47e82bcdad9e0fefd889952af0;hb=015849a4508ec793072dd648264c0f142f7db645;hpb=b0a8056223d0fdb3cbd7abf93f872c7876354de7 diff --git a/Tools/Java/Source/GenBuild/org/tianocore/build/fpd/FpdParserTask.java b/Tools/Java/Source/GenBuild/org/tianocore/build/fpd/FpdParserTask.java index 86fb256e95..719359af59 100644 --- a/Tools/Java/Source/GenBuild/org/tianocore/build/fpd/FpdParserTask.java +++ b/Tools/Java/Source/GenBuild/org/tianocore/build/fpd/FpdParserTask.java @@ -49,6 +49,7 @@ import org.tianocore.build.id.PlatformIdentification; import org.tianocore.build.pcd.action.PlatformPcdPreprocessActionForBuilding; import org.tianocore.build.toolchain.ToolChainElement; import org.tianocore.build.toolchain.ToolChainMap; +import org.tianocore.build.toolchain.ToolChainInfo; import org.w3c.dom.NamedNodeMap; import org.w3c.dom.Node; import org.w3c.dom.NodeList; @@ -337,10 +338,10 @@ public class FpdParserTask extends Task { } } } + /** This method is used for Single Module Build. - @throws BuildException FPD file is not valid. **/ @@ -447,6 +448,11 @@ public class FpdParserTask extends Task { parseToolChainFamilyOptions(); parseToolChainOptions(); + // + // check if the tool chain is valid or not + // + checkToolChain(); + saq.push(map); // @@ -516,6 +522,13 @@ public class FpdParserTask extends Task { // GlobalData.addModuleToolChainOption(fpdModuleId, parseModuleBuildOptions(false)); GlobalData.addModuleToolChainFamilyOption(fpdModuleId, parseModuleBuildOptions(true)); + + // + // parse MSA build options + // + GlobalData.addMsaBuildOption(moduleId, parseMsaBuildOptions(false)); + GlobalData.addMsaFamilyBuildOption(moduleId, parseMsaBuildOptions(true)); + saq.pop(); } } @@ -536,6 +549,14 @@ public class FpdParserTask extends Task { return parseOptions(options); } + ToolChainMap parseMsaBuildOptions(boolean toolChainFamilyFlag) throws EdkException { + String[][] options = saq.getMsaBuildOptions(toolChainFamilyFlag); + if (options == null || options.length == 0) { + return new ToolChainMap(); + } + return parseOptions(options); + } + private ToolChainMap parseOptions(String[][] options) throws EdkException { ToolChainMap map = new ToolChainMap(); int flagIndex = ToolChainElement.ATTRIBUTE.value; @@ -753,4 +774,32 @@ public class FpdParserTask extends Task { } } } + + + private void checkToolChain() throws EdkException { + ToolChainInfo toolChainInfo = GlobalData.getToolChainInfo(); + + if (toolChainInfo.getTargets().length == 0) { + throw new EdkException("No valid target found! "+ + "Please check the TARGET definition in Tools/Conf/target.txt, "+ + "or the , in the FPD file."); + } + + if (toolChainInfo.getTagnames().length == 0) { + throw new EdkException("No valid tool chain found! "+ + "Please check the TOOL_CHAIN_TAG definition in Tools/Conf/target.txt, "+ + "or the in the FPD file."); + } + + if (toolChainInfo.getArchs().length == 0) { + throw new EdkException("No valid architecture found! "+ + "Please check the TARGET_ARCH definition in Tools/Conf/target.txt, "+ + "or the , in the FPD file."); + } + + if (toolChainInfo.getCommands().length == 0) { + throw new EdkException("No valid COMMAND found! Please check the tool chain definitions "+ + "in Tools/Conf/tools_def.txt."); + } + } }