]> git.proxmox.com Git - mirror_edk2.git/commitdiff
BaseTools: Fix the bug to correctly check Pcd type that in FDF file
authorYonghong Zhu <yonghong.zhu@intel.com>
Thu, 27 Jul 2017 03:20:26 +0000 (11:20 +0800)
committerYonghong Zhu <yonghong.zhu@intel.com>
Tue, 1 Aug 2017 02:44:55 +0000 (10:44 +0800)
We set Pcd value in FDF and used this Pcd as PatchableInModule type in
module, it cause build report generate failure. because we incorrectly
set the Pcd type during check whether the Pcd is used.

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/build/BuildReport.py

index a1ee43aa26ed41d31b4f3613965876e4b4fe3db6..a7cbb6a98c28f8f3321e2c2779b672c3db6ded65 100644 (file)
@@ -737,6 +737,13 @@ class PcdReport(object):
             UnusedPcdFullList = []\r
             for item in Pa.Platform.Pcds:\r
                 Pcd = Pa.Platform.Pcds[item]\r
+                if not Pcd.Type:\r
+                    # check the Pcd in FDF file, whether it is used in module first\r
+                    for T in ["FixedAtBuild", "PatchableInModule", "FeatureFlag", "Dynamic", "DynamicEx"]:\r
+                        PcdList = self.AllPcds.setdefault(Pcd.TokenSpaceGuidCName, {}).setdefault(T, [])\r
+                        if Pcd in PcdList:\r
+                            Pcd.Type = T\r
+                            break\r
                 if not Pcd.Type:\r
                     PcdTypeFlag = False\r
                     for package in Pa.PackageList:\r