From 1fa7fdf6eada55316d7b5b45a0d116625d697fc5 Mon Sep 17 00:00:00 2001 From: "Feng, YunhuaX" Date: Thu, 1 Mar 2018 20:42:01 +0800 Subject: [PATCH] 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 --- BaseTools/Source/Python/GenFds/FdfParser.py | 4 ++++ BaseTools/Source/Python/Workspace/MetaFileParser.py | 4 ++++ 2 files changed, 8 insertions(+) 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): -- 2.39.2