BaseTools: Fix build argument --pcd for flexible format bugs

Build argument --pcd flexible format, like as:
1. VOID* type
gTokenSpaceGuid.Test=H"{flexible format}"
gTokenSpaceGuid.Test=L"string"
gTokenSpaceGuid.Test="string"
gTokenSpaceGuid.Test=L'string'
gTokenSpaceGuid.Test='string'
2. UINT8/UINT16/UINT32/UINT64 type
gTokenSpaceGuid.Test=H"{flexible format}"
gTokenSpaceGuid.Test=L"string"
gTokenSpaceGuid.Test="string"
gTokenSpaceGuid.Test=L'string'
gTokenSpaceGuid.Test='string'

In linux, single quotes need escape
gTokenSpaceGuid.Test=L\'string\'
gTokenSpaceGuid.Test=\'string\'

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>
This commit is contained in:
Feng, YunhuaX
2018-02-05 11:42:33 +08:00
committed by Yonghong Zhu
parent 17ac6b23dc
commit f9bba77495
3 changed files with 72 additions and 7 deletions

View File

@ -1554,6 +1554,8 @@ class TopLevelMakefile(BuildFile):
if pcdValue.startswith('H'):
pcdValue = 'H' + '"' + pcdValue[1:] + '"'
ExtraOption += " --pcd " + pcdName + '=' + pcdValue
elif pcdValue.startswith("L'"):
ExtraOption += "--pcd " + pcdName + '=' + pcdValue
elif pcdValue.startswith('L'):
pcdValue = 'L' + '"' + pcdValue[1:] + '"'
ExtraOption += " --pcd " + pcdName + '=' + pcdValue