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>
This commit is contained in:
@ -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(
|
||||
|
Reference in New Issue
Block a user