]> git.proxmox.com Git - mirror_edk2.git/commitdiff
BaseTools: Add build info for binary modules that only list in FDF file
authorYonghong Zhu <yonghong.zhu@intel.com>
Wed, 27 Jul 2016 08:29:38 +0000 (16:29 +0800)
committerYonghong Zhu <yonghong.zhu@intel.com>
Fri, 29 Jul 2016 08:14:12 +0000 (16:14 +0800)
If the binary module is list in the FDF file but not list in the DSC
file, current build report would not include these binary module's info
in the report "Module section". The patch fix this issue.

Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
BaseTools/Source/Python/AutoGen/AutoGen.py
BaseTools/Source/Python/build/BuildReport.py

index 9a9501415ff1fe7850877ef2029482538f276ec5..9c548be9f97f9a893fee00edd4d9743ba3af4e29 100644 (file)
@@ -1942,6 +1942,10 @@ class PlatformAutoGen(AutoGen):
     #   @retval library_list    List of library instances sorted\r
     #\r
     def ApplyLibraryInstance(self, Module):\r
+        # Cover the case that the binary INF file is list in the FDF file but not DSC file, return empty list directly\r
+        if str(Module) not in self.Platform.Modules:\r
+            return []\r
+\r
         ModuleType = Module.ModuleType\r
 \r
         # for overridding library instances with module specific setting\r
index ef99989857fac94d86d721070bcf6ecb10328704..4c57754b3b1eea42fe9ae0c5e24a26702fe91a0d 100644 (file)
@@ -47,6 +47,9 @@ from Common.DataType import TAB_BACK_SLASH
 from Common.LongFilePathSupport import OpenLongFilePath as open\r
 from Common.MultipleWorkspace import MultipleWorkspace as mws\r
 import Common.GlobalData as GlobalData\r
+from AutoGen.AutoGen import ModuleAutoGen\r
+from Common.Misc import PathClass\r
+from Common.String import NormPath\r
 \r
 ## Pattern to extract contents in EDK DXS files\r
 gDxsDependencyPattern = re.compile(r"DEPENDENCY_START(.+)DEPENDENCY_END", re.DOTALL)\r
@@ -1647,8 +1650,21 @@ class PlatformReport(object):
         else:\r
             self._IsModuleBuild = False\r
             for Pa in Wa.AutoGenObjectList:\r
+                ModuleAutoGenList = []\r
                 for ModuleKey in Pa.Platform.Modules:\r
-                    self.ModuleReportList.append(ModuleReport(Pa.Platform.Modules[ModuleKey].M, ReportType))\r
+                    ModuleAutoGenList.append(Pa.Platform.Modules[ModuleKey].M)\r
+                if GlobalData.gFdfParser != None:\r
+                    if Pa.Arch in GlobalData.gFdfParser.Profile.InfDict:\r
+                        INFList = GlobalData.gFdfParser.Profile.InfDict[Pa.Arch]\r
+                        for InfName in INFList:\r
+                            InfClass = PathClass(NormPath(InfName), Wa.WorkspaceDir, Pa.Arch)\r
+                            Ma = ModuleAutoGen(Wa, InfClass, Pa.BuildTarget, Pa.ToolChain, Pa.Arch, Wa.MetaFile)\r
+                            if Ma == None:\r
+                                continue\r
+                            if Ma not in ModuleAutoGenList:\r
+                                ModuleAutoGenList.append(Ma)\r
+                for MGen in ModuleAutoGenList:\r
+                    self.ModuleReportList.append(ModuleReport(MGen, ReportType))\r
 \r
 \r
 \r