BaseTools: Fixed the pcd value override issue.
1. the issue in the overriding value from command line. 2. dec fully value < dec field assign value < dsc fully value < dsc field assign value Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
This commit is contained in:
@ -1551,26 +1551,25 @@ class TopLevelMakefile(BuildFile):
|
||||
if GlobalData.gIgnoreSource:
|
||||
ExtraOption += " --ignore-sources"
|
||||
|
||||
if GlobalData.BuildOptionPcd:
|
||||
for index, option in enumerate(GlobalData.gCommand):
|
||||
if "--pcd" == option and GlobalData.gCommand[index+1]:
|
||||
pcdName, pcdValue = GlobalData.gCommand[index+1].split('=')
|
||||
for Item in GlobalData.BuildOptionPcd:
|
||||
if '.'.join(Item[0:2]) == pcdName:
|
||||
pcdValue = Item[2]
|
||||
if pcdValue.startswith('L') or pcdValue.startswith('"'):
|
||||
pcdValue, Size = ParseFieldValue(pcdValue)
|
||||
NewVal = '{'
|
||||
for S in range(Size):
|
||||
NewVal = NewVal + '0x%02X' % ((pcdValue >> S * 8) & 0xff)
|
||||
NewVal += ','
|
||||
pcdValue = NewVal[:-1] + '}'
|
||||
break
|
||||
if pcdValue.startswith('{'):
|
||||
pcdValue = 'H' + '"' + pcdValue + '"'
|
||||
ExtraOption += " --pcd " + pcdName + '=' + pcdValue
|
||||
else:
|
||||
ExtraOption += " --pcd " + GlobalData.gCommand[index+1]
|
||||
for index, option in enumerate(GlobalData.gCommand):
|
||||
if "--pcd" == option and GlobalData.gCommand[index+1]:
|
||||
pcdName, pcdValue = GlobalData.gCommand[index+1].split('=')
|
||||
for Item in GlobalData.BuildOptionPcd:
|
||||
if '.'.join(Item[0:2]) == pcdName:
|
||||
pcdValue = Item[2]
|
||||
if pcdValue.startswith('L') or pcdValue.startswith('"'):
|
||||
pcdValue, Size = ParseFieldValue(pcdValue)
|
||||
NewVal = '{'
|
||||
for S in range(Size):
|
||||
NewVal = NewVal + '0x%02X' % ((pcdValue >> S * 8) & 0xff)
|
||||
NewVal += ','
|
||||
pcdValue = NewVal[:-1] + '}'
|
||||
break
|
||||
if pcdValue.startswith('{'):
|
||||
pcdValue = 'H' + '"' + pcdValue + '"'
|
||||
ExtraOption += " --pcd " + pcdName + '=' + pcdValue
|
||||
else:
|
||||
ExtraOption += " --pcd " + GlobalData.gCommand[index+1]
|
||||
|
||||
MakefileName = self._FILE_NAME_[self._FileType]
|
||||
SubBuildCommandList = []
|
||||
|
Reference in New Issue
Block a user