BaseTools:Add [packages] section in dsc file
BZ:https://bugzilla.tianocore.org/show_bug.cgi?id=2270 Currently a PCD (e.g. FeaturePCD) cannot be used in a conditional statement in a DSC/FDF file without a module in the build referencing the PCD package DEC file. An example implementation that to support this is to allow a [Packages] section in the DSC file to list additional package dependencies for PCD references in the package DSC/FDF files. this patch is going to add the ability to have the [packages] section defined in the DSC file Cc: Liming Gao <liming.gao@intel.com> Cc: Bob Feng <bob.c.feng@intel.com> Signed-off-by: Zhiju.Fan <zhijux.fan@intel.com> Acked-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
This commit is contained in:
committed by
mergify[bot]
parent
7607174192
commit
bf1ea933ec
@ -719,6 +719,24 @@ class DscBuildData(PlatformBuildClassObject):
|
||||
self._RawData.DisableOverrideComponent(Components[(file_guid_str,str(ModuleFile))])
|
||||
Components[(file_guid_str,str(ModuleFile))] = ModuleId
|
||||
self._RawData._PostProcessed = False
|
||||
|
||||
## Retrieve packages this Platform depends on
|
||||
@cached_property
|
||||
def Packages(self):
|
||||
RetVal = set()
|
||||
RecordList = self._RawData[MODEL_META_DATA_PACKAGE, self._Arch]
|
||||
Macros = self._Macros
|
||||
for Record in RecordList:
|
||||
File = PathClass(NormPath(Record[0], Macros), GlobalData.gWorkspace, Arch=self._Arch)
|
||||
# check the file validation
|
||||
ErrorCode, ErrorInfo = File.Validate('.dec')
|
||||
if ErrorCode != 0:
|
||||
LineNo = Record[-1]
|
||||
EdkLogger.error('build', ErrorCode, ExtraData=ErrorInfo, File=self.MetaFile, Line=LineNo)
|
||||
# parse this package now. we need it to get protocol/ppi/guid value
|
||||
RetVal.add(self._Bdb[File, self._Arch, self._Target, self._Toolchain])
|
||||
return RetVal
|
||||
|
||||
## Retrieve [Components] section information
|
||||
@property
|
||||
def Modules(self):
|
||||
@ -896,7 +914,8 @@ class DscBuildData(PlatformBuildClassObject):
|
||||
continue
|
||||
ModuleData = self._Bdb[ModuleFile, self._Arch, self._Target, self._Toolchain]
|
||||
PkgSet.update(ModuleData.Packages)
|
||||
|
||||
if self.Packages:
|
||||
PkgSet.update(self.Packages)
|
||||
self._DecPcds, self._GuidDict = GetDeclaredPcd(self, self._Bdb, self._Arch, self._Target, self._Toolchain, PkgSet)
|
||||
self._GuidDict.update(GlobalData.gPlatformPcds)
|
||||
|
||||
@ -3320,6 +3339,8 @@ class DscBuildData(PlatformBuildClassObject):
|
||||
continue
|
||||
ModuleData = self._Bdb[ModuleFile, self._Arch, self._Target, self._Toolchain]
|
||||
PkgSet.update(ModuleData.Packages)
|
||||
if self.Packages:
|
||||
PkgSet.update(self.Packages)
|
||||
self._DecPcds, self._GuidDict = GetDeclaredPcd(self, self._Bdb, self._Arch, self._Target, self._Toolchain, PkgSet)
|
||||
self._GuidDict.update(GlobalData.gPlatformPcds)
|
||||
return self._DecPcds
|
||||
|
Reference in New Issue
Block a user