]> git.proxmox.com Git - mirror_edk2.git/commitdiff
BaseTools: Fix building FatPkg failed issue
authorFeng, Bob C <bob.c.feng@intel.com>
Tue, 26 Dec 2017 03:33:33 +0000 (11:33 +0800)
committerLiming Gao <liming.gao@intel.com>
Tue, 26 Dec 2017 03:41:34 +0000 (11:41 +0800)
Using property instead of vairable for DecPcds.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
BaseTools/Source/Python/Workspace/DscBuildData.py

index 135b608ad2714c5597b54b7c1271326978022111..054ad2c254264a92100ddd444b7d7b01bc1e2ca5 100644 (file)
@@ -1012,7 +1012,7 @@ class DscBuildData(PlatformBuildClassObject):
                             "Pcd (%s.%s) defined in DSC is not declared in DEC files. Arch: ['%s']" % (str_pcd[0], str_pcd[1], self._Arch),\r
                             File=self.MetaFile,Line = StrPcdSet[str_pcd][0][5])\r
         # Add the Structure PCD that only defined in DEC, don't have override in DSC file\r
-        for Pcd in self._DecPcds:\r
+        for Pcd in self.DecPcds:\r
             if type (self._DecPcds[Pcd]) is StructurePcd:\r
                 if Pcd not in S_pcd_set:\r
                     str_pcd_obj_str = StructurePcd()\r
@@ -1977,7 +1977,21 @@ class DscBuildData(PlatformBuildClassObject):
         if (Name, Guid) not in self.Pcds:\r
             self.Pcds[Name, Guid] = PcdClassObject(Name, Guid, '', '', '', '', '', {}, False, None)\r
         self.Pcds[Name, Guid].DefaultValue = Value\r
-\r
+    @property\r
+    def DecPcds(self):\r
+        if self._DecPcds == None:\r
+            FdfInfList = []\r
+            if GlobalData.gFdfParser:\r
+                FdfInfList = GlobalData.gFdfParser.Profile.InfList\r
+            PkgSet = set()\r
+            for Inf in FdfInfList:\r
+                ModuleFile = PathClass(NormPath(Inf), GlobalData.gWorkspace, Arch=self._Arch)\r
+                if ModuleFile in self._Modules:\r
+                    continue\r
+                ModuleData = self._Bdb[ModuleFile, self._Arch, self._Target, self._Toolchain]\r
+                PkgSet.update(ModuleData.Packages)\r
+            self._DecPcds = GetDeclaredPcd(self, self._Bdb, self._Arch, self._Target, self._Toolchain,PkgSet)\r
+        return self._DecPcds\r
     _Macros             = property(_GetMacros)\r
     Arch                = property(_GetArch, _SetArch)\r
     Platform            = property(_GetPlatformName)\r