summaryrefslogtreecommitdiffstats
path: root/BaseTools
diff options
context:
space:
mode:
authorYonghong Zhu <yonghong.zhu@intel.com>2018-03-09 15:18:35 +0800
committerYonghong Zhu <yonghong.zhu@intel.com>2018-03-10 10:41:37 +0800
commitbe80d16679897b8f19f58ac8032feceb67359af0 (patch)
tree56b2278f652a824dfbdf3cd23cb2a3607d3ce1fa /BaseTools
parent048174c51e7a9f9c8d14a75e92a708e3df05a62a (diff)
downloadedk2-be80d16679897b8f19f58ac8032feceb67359af0.tar.gz
edk2-be80d16679897b8f19f58ac8032feceb67359af0.tar.bz2
edk2-be80d16679897b8f19f58ac8032feceb67359af0.zip
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> (cherry picked from commit 705ed563de86475a32fb555d4238cc10717294f8)
Diffstat (limited to 'BaseTools')
-rw-r--r--BaseTools/Source/Python/GenFds/FdfParser.py2
-rw-r--r--BaseTools/Source/Python/GenFds/GenFds.py2
-rw-r--r--BaseTools/Source/Python/Workspace/MetaFileParser.py2
3 files changed, 5 insertions, 1 deletions
diff --git a/BaseTools/Source/Python/GenFds/FdfParser.py b/BaseTools/Source/Python/GenFds/FdfParser.py
index 76d7e6ac19..dda7ed4ce7 100644
--- a/BaseTools/Source/Python/GenFds/FdfParser.py
+++ b/BaseTools/Source/Python/GenFds/FdfParser.py
@@ -927,6 +927,8 @@ class FdfParser:
MacroDict.update(GlobalData.gCommandLineDefines)
if GlobalData.BuildOptionPcd:
for Item in GlobalData.BuildOptionPcd:
+ if type(Item) is tuple:
+ continue
PcdName, TmpValue = Item.split("=")
TmpValue = BuildOptionValue(TmpValue, {})
MacroDict[PcdName.strip()] = TmpValue
diff --git a/BaseTools/Source/Python/GenFds/GenFds.py b/BaseTools/Source/Python/GenFds/GenFds.py
index 4c56cbb02a..03126e35f4 100644
--- a/BaseTools/Source/Python/GenFds/GenFds.py
+++ b/BaseTools/Source/Python/GenFds/GenFds.py
@@ -142,6 +142,7 @@ def main():
else:
EdkLogger.error("GenFds", OPTION_MISSING, "Missing active platform")
+ GlobalData.BuildOptionPcd = Options.OptionPcd if Options.OptionPcd else {}
GenFdsGlobalVariable.ActivePlatform = PathClass(NormPath(ActivePlatform))
if (Options.ConfDirectory):
@@ -326,7 +327,6 @@ def main():
FvObj.FvRegionInFD = RegionObj.Size
RegionObj.BlockInfoOfRegion(FdObj.BlockSizeList, FvObj)
- GlobalData.BuildOptionPcd = Options.OptionPcd if Options.OptionPcd else {}
"""Call GenFds"""
GenFds.GenFd('', FdfParserObj, BuildWorkSpace, ArchList)
diff --git a/BaseTools/Source/Python/Workspace/MetaFileParser.py b/BaseTools/Source/Python/Workspace/MetaFileParser.py
index 69bdf2161b..2eb4c75e46 100644
--- a/BaseTools/Source/Python/Workspace/MetaFileParser.py
+++ b/BaseTools/Source/Python/Workspace/MetaFileParser.py
@@ -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