BaseTools: Fix two cases that use GUID CName as PCD Value
authorYonghong Zhu <yonghong.zhu@intel.com>
Fri, 23 Mar 2018 03:39:39 +0000 (11:39 +0800)
committerYonghong Zhu <yonghong.zhu@intel.com>
Tue, 10 Apr 2018 05:59:06 +0000 (13:59 +0800)
1. use CName format in components section:
  [Components]
   TestPkg/TestDriver.inf {
     <PcdsFixedAtBuild>
      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 <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
BaseTools/Source/Python/AutoGen/AutoGen.py
BaseTools/Source/Python/Workspace/InfBuildData.py

index dfc5b10569204621fc1010fd754f1b8afdb48bed..9280ae4c7df2bc04e7e023663c7ef07b0d72297e 100644 (file)
@@ -410,7 +410,8 @@ class WorkspaceAutoGen(AutoGen):
         # apply SKU and inject PCDs from Flash Definition file\r
         for Arch in self.ArchList:\r
             Platform = self.BuildDatabase[self.MetaFile, Arch, Target, Toolchain]\r
-\r
+            PlatformPcds = Platform.Pcds\r
+            self._GuidDict = Platform._GuidDict\r
             SourcePcdDict = {'DynamicEx':set(), 'PatchableInModule':set(),'Dynamic':set(),'FixedAtBuild':set()}\r
             BinaryPcdDict = {'DynamicEx':set(), 'PatchableInModule':set()}\r
             SourcePcdDict_Keys = SourcePcdDict.keys()\r
@@ -2790,7 +2791,7 @@ class ModuleAutoGen(AutoGen):
 \r
         self.Workspace = Workspace\r
         self.WorkspaceDir = Workspace.WorkspaceDir\r
-\r
+        self._GuidDict = Workspace._GuidDict\r
         self.MetaFile = ModuleFile\r
         self.PlatformInfo = PlatformAutoGen(Workspace, PlatformFile, Target, Toolchain, Arch)\r
 \r
index a7ffd43a097284ecb0e228f1837d8c71ad9602ee..e10873ae59033485d78a998bdb25201705703d4e 100644 (file)
@@ -1050,6 +1050,7 @@ class InfBuildData(ModuleBuildClassObject):
                 #\r
                 #   "FixedAtBuild", "PatchableInModule", "FeatureFlag", "Dynamic", "DynamicEx"\r
                 #\r
+                self.Guids.update(Package.Guids)\r
                 PcdType = self._PCD_TYPE_STRING_[Type]\r
                 if Type == MODEL_PCD_DYNAMIC:\r
                     Pcd.Pending = True\r