BaseTools/Build: Better DSC arch filtering

Description:
When building for any specific architecture, the build script today is loading
DSC sections for other architectures not in the build. The build process should
disregard DSC sections that are not relevant to the build.

My previous patch only fixed issue for one section type (Components). This
patch will handle all section types by updating the MetaFileParser class, which
now takes a Arch argument and will filter the DSC table results as they are
returned from the database.  The database still contains all information from
DSCs for when builds support multiple arch's

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Thomas Palmer <thomas.palmer@hpe.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
This commit is contained in:
Thomas Palmer
2016-04-28 06:32:17 +08:00
committed by Yonghong Zhu
parent 35217a337c
commit cdd1b5e548
2 changed files with 26 additions and 21 deletions

View File

@ -545,12 +545,6 @@ class DscBuildData(PlatformBuildClassObject):
for Record in RecordList:
DuplicatedFile = False
# process only records COMMON and self.Arch
SectionArch = Record[3].upper()
if SectionArch != 'COMMON':
if SectionArch != self.Arch:
continue
ModuleFile = PathClass(NormPath(Record[0], Macros), GlobalData.gWorkspace, Arch=self._Arch)
ModuleId = Record[5]
LineNo = Record[6]
@ -2859,6 +2853,7 @@ class WorkspaceDatabase(object):
MetaFile = self._FILE_PARSER_[FileType](
FilePath,
FileType,
Arch,
MetaFileStorage(self.WorkspaceDb.Cur, FilePath, FileType)
)
# alwasy do post-process, in case of macros change