BaseTools: Dsc/Fdf conditional statement parse issue
authorFeng, YunhuaX </o=Intel/ou=Exchange Administrative Group (FYDIBOHF23SPDLT)/cn=Recipients/cn=Feng, YunhuaX4e1>
Thu, 1 Mar 2018 12:42:01 +0000 (20:42 +0800)
committerYonghong Zhu <yonghong.zhu@intel.com>
Sat, 3 Mar 2018 01:20:12 +0000 (09:20 +0800)
Set PCD value with --pcd argument not replace DSC/Fdf 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>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
BaseTools/Source/Python/GenFds/FdfParser.py
BaseTools/Source/Python/Workspace/MetaFileParser.py

index 44a3564c7c1d0f00d25e805137ceca6008ad603b..fc2b409847be5b24a5e774a055ae6214089d4f59 100644 (file)
@@ -925,6 +925,10 @@ class FdfParser:
 \r
         MacroDict.update(GlobalData.gGlobalDefines)\r
         MacroDict.update(GlobalData.gCommandLineDefines)\r
+        if GlobalData.BuildOptionPcd:\r
+            for Item in GlobalData.BuildOptionPcd:\r
+                PcdName, TmpValue = Item.split("=")\r
+                MacroDict[PcdName.strip()] = TmpValue\r
         # Highest priority\r
 \r
         return MacroDict\r
index 95ea6fb45abb5af1704c5dae9e0e316c6ab5684d..6809003d984691c0b906fed0b16092652d6baac4 100644 (file)
@@ -1243,6 +1243,10 @@ class DscParser(MetaFileParser):
         # PCD cannot be referenced in macro definition\r
         if self._ItemType not in [MODEL_META_DATA_DEFINE, MODEL_META_DATA_GLOBAL_DEFINE]:\r
             Macros.update(self._Symbols)\r
+        if GlobalData.BuildOptionPcd:\r
+            for Item in GlobalData.BuildOptionPcd:\r
+                PcdName, TmpValue = Item.split("=")\r
+                Macros[PcdName.strip()] = TmpValue\r
         return Macros\r
 \r
     def _PostProcess(self):\r