Fixed an issue which a library module could be built even it's not in the active...
[mirror_edk2.git] / Tools / Java / Source / GenBuild / org / tianocore / build / GenBuildTask.java
index 3c21c40..468b5f9 100644 (file)
@@ -275,8 +275,13 @@ public class GenBuildTask extends Ant {
             //\r
             // Whether the module is built before\r
             //\r
-            if (moduleId.isLibrary() == false && GlobalData.hasFpdModuleSA(fpdModuleId) == false) {\r
-                EdkLog.log(this, EdkLog.EDK_WARNING, "Warning: " + moduleId + " for " + archList[k] + " was not found in current platform FPD file!\n");\r
+            if ((moduleId.isLibrary() == false || isSingleModuleBuild) && GlobalData.hasFpdModuleSA(fpdModuleId) == false) {\r
+                if (isSingleModuleBuild) {\r
+                    EdkLog.log(this, EdkLog.EDK_ERROR, "Error: " + moduleId + " for " + archList[k] + " was not found in current platform FPD file!\n");\r
+                    throw new BuildException("No platform containing this module!");\r
+                } else {\r
+                    EdkLog.log(this, EdkLog.EDK_WARNING, "Warning: " + moduleId + " for " + archList[k] + " was not found in current platform FPD file!\n");\r
+                }\r
                 continue;\r
             } else if (GlobalData.isModuleBuilt(fpdModuleId)) {\r
                 break;\r