BaseTools: Fixed an issue that build raise exception

BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2047

Build raise exception if there is libraryclass
missing in dsc file and --pcd build option is used.

Build should report the missing libraryclass but not
a call stack.

This patch is going to fix it.

Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Bob Feng <bob.c.feng@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
This commit is contained in:
Feng, Bob C 2019-08-02 14:40:31 +08:00
parent 4053587347
commit a0792697bc
1 changed files with 2 additions and 5 deletions

View File

@ -1075,13 +1075,10 @@ class DscBuildData(PlatformBuildClassObject):
GlobalData.BuildOptionPcd[i] = (TokenSpaceGuidCName, TokenCName, FieldName, pcdvalue, ("build command options", 1))
if GlobalData.BuildOptionPcd:
inf_objs = [item for item in self._Bdb._CACHE_.values() if item.Arch == self.Arch and item.MetaFile.Ext.lower() == '.inf']
for pcd in GlobalData.BuildOptionPcd:
(TokenSpaceGuidCName, TokenCName, FieldName, pcdvalue, _) = pcd
for BuildData in self._Bdb._CACHE_.values():
if BuildData.Arch != self.Arch:
continue
if BuildData.MetaFile.Ext == '.dec' or BuildData.MetaFile.Ext == '.dsc':
continue
for BuildData in inf_objs:
for key in BuildData.Pcds:
PcdItem = BuildData.Pcds[key]
if (TokenSpaceGuidCName, TokenCName) == (PcdItem.TokenSpaceGuidCName, PcdItem.TokenCName) and FieldName =="":