BaseTools: Fix a bug for --pcd used in ConditionalStatement calculate

Move the GlobalData.BuildOptionPcd before FdfParser() function and add
type check for Pcd item.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
This commit is contained in:
Yonghong Zhu
2018-03-09 15:18:35 +08:00
parent 8565b5829c
commit 705ed563de
3 changed files with 5 additions and 1 deletions

View File

@ -1245,6 +1245,8 @@ class DscParser(MetaFileParser):
Macros.update(self._Symbols)
if GlobalData.BuildOptionPcd:
for Item in GlobalData.BuildOptionPcd:
if type(Item) is tuple:
continue
PcdName, TmpValue = Item.split("=")
TmpValue = BuildOptionValue(TmpValue, self._GuidDict)
Macros[PcdName.strip()] = TmpValue