From f9fa014ee01cd8ecda091e1c1d9cb09724957e72 Mon Sep 17 00:00:00 2001 From: Yonghong Zhu Date: Fri, 23 Mar 2018 11:39:39 +0800 Subject: [PATCH] BaseTools: Fix two cases that use GUID CName as PCD Value 1. use CName format in components section: [Components] TestPkg/TestDriver.inf { PcdToken.PcdName |{GUID(TestGuid)}|VOID*|16 } 2. Use Guid CName format in INF and the Guid is defined in the DEC file but not write in driver's [Guids] section. PcdToken.PcdName | {GUID(TestGuid)} Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yonghong Zhu Reviewed-by: Liming Gao --- BaseTools/Source/Python/AutoGen/AutoGen.py | 5 +++-- BaseTools/Source/Python/Workspace/InfBuildData.py | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py b/BaseTools/Source/Python/AutoGen/AutoGen.py index dfc5b10569..9280ae4c7d 100644 --- a/BaseTools/Source/Python/AutoGen/AutoGen.py +++ b/BaseTools/Source/Python/AutoGen/AutoGen.py @@ -410,7 +410,8 @@ class WorkspaceAutoGen(AutoGen): # apply SKU and inject PCDs from Flash Definition file for Arch in self.ArchList: Platform = self.BuildDatabase[self.MetaFile, Arch, Target, Toolchain] - + PlatformPcds = Platform.Pcds + self._GuidDict = Platform._GuidDict SourcePcdDict = {'DynamicEx':set(), 'PatchableInModule':set(),'Dynamic':set(),'FixedAtBuild':set()} BinaryPcdDict = {'DynamicEx':set(), 'PatchableInModule':set()} SourcePcdDict_Keys = SourcePcdDict.keys() @@ -2790,7 +2791,7 @@ class ModuleAutoGen(AutoGen): self.Workspace = Workspace self.WorkspaceDir = Workspace.WorkspaceDir - + self._GuidDict = Workspace._GuidDict self.MetaFile = ModuleFile self.PlatformInfo = PlatformAutoGen(Workspace, PlatformFile, Target, Toolchain, Arch) diff --git a/BaseTools/Source/Python/Workspace/InfBuildData.py b/BaseTools/Source/Python/Workspace/InfBuildData.py index a7ffd43a09..e10873ae59 100644 --- a/BaseTools/Source/Python/Workspace/InfBuildData.py +++ b/BaseTools/Source/Python/Workspace/InfBuildData.py @@ -1050,6 +1050,7 @@ class InfBuildData(ModuleBuildClassObject): # # "FixedAtBuild", "PatchableInModule", "FeatureFlag", "Dynamic", "DynamicEx" # + self.Guids.update(Package.Guids) PcdType = self._PCD_TYPE_STRING_[Type] if Type == MODEL_PCD_DYNAMIC: Pcd.Pending = True -- 2.39.2