BaseTools/Build: Output warning message for library class mismatch

Performs a check that will verify that the library instance implements
the library specified in the dsc by ensuring a LIBRARY_CLASS definition
exists in the INF [Defines] section and the value matches the library it
says it is implementing.

As an example, from a platform dsc file:
BaseBmpSupportLib|MdeModulePkg/Library/BaseBmpSupportLib/BaseBmpSupportLib.inf

BaseBmpSupportLib is supposed to be of library class BmpSupportLib, but the
dsc defines it incorrectly, the warning message will be displayed during
build.

Signed-off-by: Aaron Pop <aaronpop@microsoft.com>
Co-authored-by: Poncho Figueroa <poncho.figueroa.esqueda@intel.com>
This commit is contained in:
Joey Vagedes 2024-07-02 10:27:02 -07:00 committed by mergify[bot]
parent 909d1db4cb
commit c5aa7e7d94
5 changed files with 117 additions and 4 deletions

View file

@ -1728,6 +1728,26 @@ class DscParser(MetaFileParser):
self._ValueList = [ReplaceMacro(Value, self._Macros, RaiseError=False)
for Value in self._ValueList]
## Find the file a record's line number refers to
#
# !include'd records are spliced into the including file's record list, so
# a record's line number is not necessarily an offset into self.MetaFile.
# Callers reporting a line number to the user should report this path with
# it rather than assuming the top-level DSC.
#
# @param RecordId: ID of the record to locate
#
# @retval: Path of the file the record was parsed from
#
def GetOriginFile(self, RecordId):
for Table in (self._Table, self._RawTable):
if Table is None:
continue
OriginFile = Table.GetOriginFile(RecordId)
if OriginFile is not None:
return OriginFile
return self.MetaFile
def DisableOverrideComponent(self,module_id):
for ori_id in self._IdMapping:
if self._IdMapping[ori_id] == module_id: