mirror of
https://github.com/tianocore/edk2
synced 2026-08-27 00:23:19 -04:00
BaseTools/Build: Fix arch macro expansion scope in DSC parser
Signed-off-by: Kirk Chou <kirk.chou@hpe.com>
This commit is contained in:
parent
12c5ded287
commit
34a3cc89de
1 changed files with 11 additions and 1 deletions
|
|
@ -1400,6 +1400,17 @@ class DscParser(MetaFileParser):
|
|||
|
||||
self._Scope = [[S1, S2, S3]]
|
||||
#
|
||||
# Expand macros in arch field for all records so that per-module
|
||||
# sub-items (e.g. <LibraryClasses> under [Components.$(PEI_ARCH)])
|
||||
# resolve correctly, not just the Component record itself.
|
||||
#
|
||||
self._Scope[0][0] = ReplaceMacro(self._Scope[0][0], self._Macros)
|
||||
if '$(' in self._Scope[0][0] and S1 != TAB_ARCH_COMMON:
|
||||
EdkLogger.warn("Parser",
|
||||
"Macro in arch field was not resolved. "
|
||||
"'%s' used in section header is not defined." % S1,
|
||||
File=self._FileWithError, Line=LineStart)
|
||||
#
|
||||
# For !include directive, handle it specially,
|
||||
# merge arch and module type in case of duplicate items
|
||||
#
|
||||
|
|
@ -1712,7 +1723,6 @@ class DscParser(MetaFileParser):
|
|||
|
||||
def __ProcessComponent(self):
|
||||
self._ValueList[0] = ReplaceMacro(self._ValueList[0], self._Macros)
|
||||
self._Scope[0][0] = ReplaceMacro(self._Scope[0][0], self._Macros)
|
||||
|
||||
def __ProcessBuildOption(self):
|
||||
self._ValueList = [ReplaceMacro(Value, self._Macros, RaiseError=False)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue