summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Tools/Java/Source/GenBuild/org/tianocore/build/fpd/FpdParserTask.java27
-rw-r--r--Tools/Java/Source/GenBuild/org/tianocore/build/global/GlobalData.java18
2 files changed, 28 insertions, 17 deletions
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 28379796f4..7d86c64a2d 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;
@@ -447,6 +448,11 @@ public class FpdParserTask extends Task {
parseToolChainFamilyOptions();
parseToolChainOptions();
+ //
+ // check if the tool chain is valid or not
+ //
+ checkToolChain();
+
saq.push(map);
//
@@ -768,4 +774,25 @@ 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 specified! Please check your TARGET definition in Tools/Conf/target.txt.");
+ }
+
+ if (toolChainInfo.getTagnames().length == 0) {
+ throw new EdkException("No valid tool chain specified! Please check your TOOL_CHAIN_TAG definition in Tools/Conf/target.txt.");
+ }
+
+ if (toolChainInfo.getArchs().length == 0) {
+ throw new EdkException("No valid ARCH specified! Please check your TARGET_ARCH definition in Tools/Conf/target.txt.");
+ }
+
+ if (toolChainInfo.getCommands().length == 0) {
+ throw new EdkException("No valid COMMAND specified! Please check your TARGET definition in Tools/Conf/tools_def.txt.");
+ }
+ }
}
diff --git a/Tools/Java/Source/GenBuild/org/tianocore/build/global/GlobalData.java b/Tools/Java/Source/GenBuild/org/tianocore/build/global/GlobalData.java
index b79e505210..96558876e4 100644
--- a/Tools/Java/Source/GenBuild/org/tianocore/build/global/GlobalData.java
+++ b/Tools/Java/Source/GenBuild/org/tianocore/build/global/GlobalData.java
@@ -682,7 +682,7 @@ public class GlobalData {
///
/// Tool Chain Related, try to refine and put some logic process to ToolChainFactory
///
- public synchronized static ToolChainInfo getToolChainInfo() throws EdkException {
+ public synchronized static ToolChainInfo getToolChainInfo() {
if (toolChainInfo == null) {
toolChainInfo = toolsDef.getConfigInfo().intersection(toolChainEnvInfo);
if (toolChainPlatformInfo != null) {
@@ -691,22 +691,6 @@ public class GlobalData {
toolChainInfo.addCommands(toolsDef.getConfigInfo().getCommands());
toolChainInfo.normalize();
- if (toolChainInfo.getTargets().length == 0) {
- throw new EdkException("No valid target specified! Please check your TARGET definition in Tools/Conf/target.txt.");
- }
-
- if (toolChainInfo.getTagnames().length == 0) {
- throw new EdkException("No valid tool chain specified! Please check your TOOL_CHAIN_TAG definition in Tools/Conf/target.txt.");
- }
-
- if (toolChainInfo.getArchs().length == 0) {
- throw new EdkException("No valid ARCH specified! Please check your TARGET_ARCH definition in Tools/Conf/target.txt.");
- }
-
- if (toolChainInfo.getCommands().length == 0) {
- throw new EdkException("No valid COMMAND specified! Please check your TARGET definition in Tools/Conf/tools_def.txt.");
- }
-
EdkLog.log("Init", EdkLog.EDK_ALWAYS, "Current build tool chain information summary: ");
EdkLog.log("Init", EdkLog.EDK_ALWAYS, toolChainInfo + "");
}