From: Feng, YunhuaX Date: Thu, 1 Mar 2018 12:42:01 +0000 (+0800) Subject: BaseTools: Dsc/Fdf conditional statement parse issue X-Git-Tag: edk2-stable201903~2290 X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=commitdiff_plain;h=1fa7fdf6eada55316d7b5b45a0d116625d697fc5 BaseTools: Dsc/Fdf conditional statement parse issue Set PCD value with --pcd argument not replace DSC/Fdf PCD value. Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yunhua Feng Reviewed-by: Yonghong Zhu --- diff --git a/BaseTools/Source/Python/GenFds/FdfParser.py b/BaseTools/Source/Python/GenFds/FdfParser.py index 44a3564c7c..fc2b409847 100644 --- a/BaseTools/Source/Python/GenFds/FdfParser.py +++ b/BaseTools/Source/Python/GenFds/FdfParser.py @@ -925,6 +925,10 @@ class FdfParser: MacroDict.update(GlobalData.gGlobalDefines) MacroDict.update(GlobalData.gCommandLineDefines) + if GlobalData.BuildOptionPcd: + for Item in GlobalData.BuildOptionPcd: + PcdName, TmpValue = Item.split("=") + MacroDict[PcdName.strip()] = TmpValue # Highest priority return MacroDict diff --git a/BaseTools/Source/Python/Workspace/MetaFileParser.py b/BaseTools/Source/Python/Workspace/MetaFileParser.py index 95ea6fb45a..6809003d98 100644 --- a/BaseTools/Source/Python/Workspace/MetaFileParser.py +++ b/BaseTools/Source/Python/Workspace/MetaFileParser.py @@ -1243,6 +1243,10 @@ class DscParser(MetaFileParser): # PCD cannot be referenced in macro definition if self._ItemType not in [MODEL_META_DATA_DEFINE, MODEL_META_DATA_GLOBAL_DEFINE]: Macros.update(self._Symbols) + if GlobalData.BuildOptionPcd: + for Item in GlobalData.BuildOptionPcd: + PcdName, TmpValue = Item.split("=") + Macros[PcdName.strip()] = TmpValue return Macros def _PostProcess(self):