From 726c501c2c9a1ef103fab7846e2d1a34506715d8 Mon Sep 17 00:00:00 2001 From: Yonghong Zhu Date: Tue, 26 Dec 2017 16:17:13 +0800 Subject: 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 Signed-off-by: Yonghong Zhu Reviewed-by: Liming Gao --- BaseTools/Source/Python/Workspace/InfBuildData.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'BaseTools/Source/Python/Workspace/InfBuildData.py') 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( -- cgit v1.2.3