From: Yunhua Feng Date: Tue, 10 Apr 2018 02:50:25 +0000 (+0800) Subject: BaseTools: Support DSC component !include PCD items X-Git-Tag: edk2-stable201903~1864 X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=commitdiff_plain;h=3378782691af1158560579444a23bdd2f0a7d154 BaseTools: Support DSC component !include PCD items DSC format: [Components] TestPkg/TestDriver.inf { !include TestPkg/Test.txt } Test.txt content: PcdToken.PcdCName | 0x123 Per spec we should support this usage. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yunhua Feng Reviewed-by: Yonghong Zhu --- diff --git a/BaseTools/Source/Python/Workspace/MetaFileParser.py b/BaseTools/Source/Python/Workspace/MetaFileParser.py index 3d12314717..322ed38449 100644 --- a/BaseTools/Source/Python/Workspace/MetaFileParser.py +++ b/BaseTools/Source/Python/Workspace/MetaFileParser.py @@ -1538,9 +1538,13 @@ class DscParser(MetaFileParser): self._FileWithError = IncludedFile1 IncludedFileTable = MetaFileStorage(self._Table.Cur, IncludedFile1, MODEL_FILE_DSC, False) - Owner = self._Content[self._ContentIndex - 1][0] + FromItem = self._Content[self._ContentIndex - 1][0] + if self._Content[self._ContentIndex - 1][8] != -1.0: + Owner = self._Content[self._ContentIndex - 1][8] + else: + Owner = self._Content[self._ContentIndex - 1][0] Parser = DscParser(IncludedFile1, self._FileType, self._Arch, IncludedFileTable, - Owner=Owner, From=Owner) + Owner=Owner, From=FromItem) self.IncludedFiles.add (IncludedFile1) @@ -1552,7 +1556,10 @@ class DscParser(MetaFileParser): # set the parser status with current status Parser._SectionName = self._SectionName - Parser._SectionType = self._SectionType + if self._InSubsection: + Parser._SectionType = self._SubsectionType + else: + Parser._SectionType = self._SectionType Parser._Scope = self._Scope Parser._Enabled = self._Enabled # Parse the included file