]> git.proxmox.com Git - mirror_edk2.git/commitdiff
BaseTools: Fix the bug when use FILE_GUID override the module in DSC
authorYonghong Zhu <yonghong.zhu@intel.com>
Wed, 3 Aug 2016 09:09:18 +0000 (17:09 +0800)
committerYonghong Zhu <yonghong.zhu@intel.com>
Mon, 8 Aug 2016 02:53:30 +0000 (10:53 +0800)
In last commit 2502b73, it doesn't cover the case that in the DSC file
use FILE_GUID to override the module.

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

index 921b97916327a6988592243d24acb1e34315b21d..79bc7c6ced839c091002011a75b43f4c7e1bb412 100644 (file)
@@ -330,15 +330,21 @@ class WorkspaceAutoGen(AutoGen):
                     EdkLogger.error("build", OPTION_VALUE_INVALID,\r
                                     "No such an FV in FDF file: %s" % fvname)\r
 \r
+            # In DSC file may use FILE_GUID to override the module, then in the Platform.Modules use FILE_GUIDmodule.inf as key,\r
+            # but the path (self.MetaFile.Path) is the real path\r
             for key in self.FdfProfile.InfDict:\r
                 if key == 'ArchTBD':\r
                     Platform_cache = {}\r
+                    MetaFile_cache = {}\r
                     for Arch in self.ArchList:\r
                         Platform_cache[Arch] = self.BuildDatabase[self.MetaFile, Arch, Target, Toolchain]\r
+                        MetaFile_cache[Arch] = []\r
+                        for Pkey in Platform_cache[Arch].Modules.keys():\r
+                            MetaFile_cache[Arch].append(Platform_cache[Arch].Modules[Pkey].MetaFile)\r
                     for Inf in self.FdfProfile.InfDict[key]:\r
                         ModuleFile = PathClass(NormPath(Inf), GlobalData.gWorkspace, Arch)\r
                         for Arch in self.ArchList:\r
-                            if ModuleFile in Platform_cache[Arch].Modules:\r
+                            if ModuleFile in MetaFile_cache[Arch]:\r
                                 break\r
                         else:\r
                             ModuleData = self.BuildDatabase[ModuleFile, Arch, Target, Toolchain]\r
@@ -349,9 +355,12 @@ class WorkspaceAutoGen(AutoGen):
                     for Arch in self.ArchList:\r
                         if Arch == key:\r
                             Platform = self.BuildDatabase[self.MetaFile, Arch, Target, Toolchain]\r
+                            MetaFileList = []\r
+                            for Pkey in Platform.Modules.keys():\r
+                                MetaFileList.append(Platform.Modules[Pkey].MetaFile)\r
                             for Inf in self.FdfProfile.InfDict[key]:\r
                                 ModuleFile = PathClass(NormPath(Inf), GlobalData.gWorkspace, Arch)\r
-                                if ModuleFile in Platform.Modules:\r
+                                if ModuleFile in MetaFileList:\r
                                     continue\r
                                 ModuleData = self.BuildDatabase[ModuleFile, Arch, Target, Toolchain]\r
                                 if not ModuleData.IsBinaryModule:\r