[edk2] [PATCH] BaseTools: Dsc conditional statement parse issue

Feng, YunhuaX posted 1 patch 6 years, 1 month ago
Failed in applying to current master (apply log)
BaseTools/Source/Python/Workspace/MetaFileParser.py | 5 +++++
1 file changed, 5 insertions(+)
[edk2] [PATCH] BaseTools: Dsc conditional statement parse issue
Posted by Feng, YunhuaX 6 years, 1 month ago
Set PCD value with --pcd argument not replace
DSC PCD value.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1

Signed-off-by: Yunhua Feng <yunhuax.feng@intel.com>
---
 BaseTools/Source/Python/Workspace/MetaFileParser.py | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/BaseTools/Source/Python/Workspace/MetaFileParser.py b/BaseTools/Source/Python/Workspace/MetaFileParser.py
index 95ea6fb45a..69a591b8f3 100644
--- a/BaseTools/Source/Python/Workspace/MetaFileParser.py
+++ b/BaseTools/Source/Python/Workspace/MetaFileParser.py
@@ -1601,10 +1601,15 @@ class DscParser(MetaFileParser):
         if ValList[Index] == 'False':
             ValList[Index] = '0'
 
         if (not self._DirectiveEvalStack) or (False not in self._DirectiveEvalStack):
             GlobalData.gPlatformPcds[TAB_SPLIT.join(self._ValueList[0:2])] = PcdValue
+            if GlobalData.BuildOptionPcd:
+                for Item in GlobalData.BuildOptionPcd:
+                    PcdName, TmpValue = Item.split("=")
+                    if PcdName.strip() == TAB_SPLIT.join(self._ValueList[0:2]):
+                        PcdValue = TmpValue
             self._Symbols[TAB_SPLIT.join(self._ValueList[0:2])] = PcdValue
         try:
             self._ValueList[2] = '|'.join(ValList)
         except Exception:
             print ValList
-- 
2.12.2.windows.2

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel