summaryrefslogtreecommitdiffstats
path: root/BaseTools
diff options
context:
space:
mode:
authorYunhua Feng <yunhuax.feng@intel.com>2018-05-14 09:54:46 +0800
committerYonghong Zhu <yonghong.zhu@intel.com>2018-05-22 19:34:33 +0800
commit5a444dfd7c0039b33f0c26e1294297fb7e358f60 (patch)
treec95aec7b4839a6dcde5121d061d9058f9c01ff0f /BaseTools
parent74f59e927520f50c4ebeeb2ccaa8e611b7d48dd1 (diff)
downloadedk2-5a444dfd7c0039b33f0c26e1294297fb7e358f60.tar.gz
edk2-5a444dfd7c0039b33f0c26e1294297fb7e358f60.tar.bz2
edk2-5a444dfd7c0039b33f0c26e1294297fb7e358f60.zip
BaseTools: Library PCD type will inherit from the driver
If a PCD is not referenced in global PCD section of DSC file at all, but is referenced in module scope, then the default PCD type for libs should be the module scoped PCD type. Fixes: https://bugzilla.tianocore.org/show_bug.cgi?id=901 Cc: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yunhua Feng <yunhuax.feng@intel.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
Diffstat (limited to 'BaseTools')
-rw-r--r--BaseTools/Source/Python/AutoGen/AutoGen.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py b/BaseTools/Source/Python/AutoGen/AutoGen.py
index cfa69655a9..14d5a94afa 100644
--- a/BaseTools/Source/Python/AutoGen/AutoGen.py
+++ b/BaseTools/Source/Python/AutoGen/AutoGen.py
@@ -432,6 +432,22 @@ class WorkspaceAutoGen(AutoGen):
if PcdInPlatform.Type:
BuildData.Pcds[key].Type = PcdInPlatform.Type
BuildData.Pcds[key].Pending = False
+ else:
+ #Pcd used in Library, Pcd Type from reference module if Pcd Type is Pending
+ if BuildData.Pcds[key].Pending:
+ MGen = ModuleAutoGen(self, BuildData.MetaFile, Target, Toolchain, Arch, self.MetaFile)
+ if MGen and MGen.IsLibrary:
+ if MGen in PGen.LibraryAutoGenList:
+ ReferenceModules = MGen._ReferenceModules
+ for ReferenceModule in ReferenceModules:
+ if ReferenceModule.MetaFile in Platform.Modules:
+ RefPlatformModule = Platform.Modules[str(ReferenceModule.MetaFile)]
+ if key in RefPlatformModule.Pcds:
+ PcdInReferenceModule = RefPlatformModule.Pcds[key]
+ if PcdInReferenceModule.Type:
+ BuildData.Pcds[key].Type = PcdInReferenceModule.Type
+ BuildData.Pcds[key].Pending = False
+ break
if TAB_PCDS_DYNAMIC_EX in BuildData.Pcds[key].Type:
if BuildData.IsBinaryModule: