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:
@ -927,6 +927,8 @@ class FdfParser:
|
|||||||
MacroDict.update(GlobalData.gCommandLineDefines)
|
MacroDict.update(GlobalData.gCommandLineDefines)
|
||||||
if GlobalData.BuildOptionPcd:
|
if GlobalData.BuildOptionPcd:
|
||||||
for Item in GlobalData.BuildOptionPcd:
|
for Item in GlobalData.BuildOptionPcd:
|
||||||
|
if type(Item) is tuple:
|
||||||
|
continue
|
||||||
PcdName, TmpValue = Item.split("=")
|
PcdName, TmpValue = Item.split("=")
|
||||||
TmpValue = BuildOptionValue(TmpValue, {})
|
TmpValue = BuildOptionValue(TmpValue, {})
|
||||||
MacroDict[PcdName.strip()] = TmpValue
|
MacroDict[PcdName.strip()] = TmpValue
|
||||||
|
@ -142,6 +142,7 @@ def main():
|
|||||||
else:
|
else:
|
||||||
EdkLogger.error("GenFds", OPTION_MISSING, "Missing active platform")
|
EdkLogger.error("GenFds", OPTION_MISSING, "Missing active platform")
|
||||||
|
|
||||||
|
GlobalData.BuildOptionPcd = Options.OptionPcd if Options.OptionPcd else {}
|
||||||
GenFdsGlobalVariable.ActivePlatform = PathClass(NormPath(ActivePlatform))
|
GenFdsGlobalVariable.ActivePlatform = PathClass(NormPath(ActivePlatform))
|
||||||
|
|
||||||
if (Options.ConfDirectory):
|
if (Options.ConfDirectory):
|
||||||
@ -326,7 +327,6 @@ def main():
|
|||||||
FvObj.FvRegionInFD = RegionObj.Size
|
FvObj.FvRegionInFD = RegionObj.Size
|
||||||
RegionObj.BlockInfoOfRegion(FdObj.BlockSizeList, FvObj)
|
RegionObj.BlockInfoOfRegion(FdObj.BlockSizeList, FvObj)
|
||||||
|
|
||||||
GlobalData.BuildOptionPcd = Options.OptionPcd if Options.OptionPcd else {}
|
|
||||||
"""Call GenFds"""
|
"""Call GenFds"""
|
||||||
GenFds.GenFd('', FdfParserObj, BuildWorkSpace, ArchList)
|
GenFds.GenFd('', FdfParserObj, BuildWorkSpace, ArchList)
|
||||||
|
|
||||||
|
@ -1245,6 +1245,8 @@ class DscParser(MetaFileParser):
|
|||||||
Macros.update(self._Symbols)
|
Macros.update(self._Symbols)
|
||||||
if GlobalData.BuildOptionPcd:
|
if GlobalData.BuildOptionPcd:
|
||||||
for Item in GlobalData.BuildOptionPcd:
|
for Item in GlobalData.BuildOptionPcd:
|
||||||
|
if type(Item) is tuple:
|
||||||
|
continue
|
||||||
PcdName, TmpValue = Item.split("=")
|
PcdName, TmpValue = Item.split("=")
|
||||||
TmpValue = BuildOptionValue(TmpValue, self._GuidDict)
|
TmpValue = BuildOptionValue(TmpValue, self._GuidDict)
|
||||||
Macros[PcdName.strip()] = TmpValue
|
Macros[PcdName.strip()] = TmpValue
|
||||||
|
Reference in New Issue
Block a user