summaryrefslogtreecommitdiffstats
path: root/BaseTools/Source/Python/Workspace/InfBuildData.py
diff options
context:
space:
mode:
authorYonghong Zhu <yonghong.zhu@intel.com>2017-12-26 16:17:13 +0800
committerYonghong Zhu <yonghong.zhu@intel.com>2017-12-27 14:43:27 +0800
commit726c501c2c9a1ef103fab7846e2d1a34506715d8 (patch)
tree51c6cb2ce0a1a49400d8ef2255327dd330b177f1 /BaseTools/Source/Python/Workspace/InfBuildData.py
parent68ba919f7858830cc764b46a00da7e7fdcd1f3ec (diff)
downloadedk2-726c501c2c9a1ef103fab7846e2d1a34506715d8.tar.gz
edk2-726c501c2c9a1ef103fab7846e2d1a34506715d8.tar.bz2
edk2-726c501c2c9a1ef103fab7846e2d1a34506715d8.zip
BaseTools: Support PCD flexible values format
https://bugzilla.tianocore.org/show_bug.cgi?id=541 Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yunhua Feng <yunhuax.feng@intel.com> Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
Diffstat (limited to 'BaseTools/Source/Python/Workspace/InfBuildData.py')
-rw-r--r--BaseTools/Source/Python/Workspace/InfBuildData.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/BaseTools/Source/Python/Workspace/InfBuildData.py b/BaseTools/Source/Python/Workspace/InfBuildData.py
index fd94067c93..7ea9b56d5d 100644
--- a/BaseTools/Source/Python/Workspace/InfBuildData.py
+++ b/BaseTools/Source/Python/Workspace/InfBuildData.py
@@ -16,6 +16,7 @@ from Common.String import *
from Common.DataType import *
from Common.Misc import *
from types import *
+from MetaFileParser import *
from Workspace.BuildClassObject import ModuleBuildClassObject, LibraryClassObject, PcdClassObject
## Module build information from INF file
@@ -1144,6 +1145,12 @@ class InfBuildData(ModuleBuildClassObject):
Pcd.InfDefaultValue = Pcd.DefaultValue
if Pcd.DefaultValue in [None, '']:
Pcd.DefaultValue = PcdInPackage.DefaultValue
+ else:
+ try:
+ Pcd.DefaultValue = ValueExpressionEx(Pcd.DefaultValue, Pcd.DatumType, self.Guids)(True)
+ except BadExpression, Value:
+ EdkLogger.error('Parser', FORMAT_INVALID, 'PCD [%s.%s] Value "%s", %s' %(TokenSpaceGuid, PcdRealName, Pcd.DefaultValue, Value),
+ File=self.MetaFile, Line=LineNo)
break
else:
EdkLogger.error(