summaryrefslogtreecommitdiffstats
path: root/BaseTools/Source/Python/GenFds/GenFds.py
diff options
context:
space:
mode:
authorYonghong Zhu <yonghong.zhu@intel.com>2017-05-12 12:12:23 +0800
committerYonghong Zhu <yonghong.zhu@intel.com>2017-05-12 13:36:20 +0800
commitdb55dac77579fa2722e4457bfc4369f98b8ff52a (patch)
tree2693024292c3c5d526941b29e2c8bc0c2df21aa5 /BaseTools/Source/Python/GenFds/GenFds.py
parent7256bd55e9883bbdfda32733eb533ddeccd3e2da (diff)
downloadedk2-db55dac77579fa2722e4457bfc4369f98b8ff52a.tar.gz
edk2-db55dac77579fa2722e4457bfc4369f98b8ff52a.tar.bz2
edk2-db55dac77579fa2722e4457bfc4369f98b8ff52a.zip
BaseTools: Fix the bug for CArray PCD override in command line
This patch updated the CArray PCD override format from B"{}" to H"{}" which align to build spec. Besides, it also do the clean up for the function BuildOptionPcdValueFormat. Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
Diffstat (limited to 'BaseTools/Source/Python/GenFds/GenFds.py')
-rw-r--r--BaseTools/Source/Python/GenFds/GenFds.py26
1 files changed, 1 insertions, 25 deletions
diff --git a/BaseTools/Source/Python/GenFds/GenFds.py b/BaseTools/Source/Python/GenFds/GenFds.py
index aa8c04123a..277da357af 100644
--- a/BaseTools/Source/Python/GenFds/GenFds.py
+++ b/BaseTools/Source/Python/GenFds/GenFds.py
@@ -39,6 +39,7 @@ from Common.Misc import SaveFileOnChange
from Common.Misc import ClearDuplicatedInf
from Common.Misc import GuidStructureStringToGuidString
from Common.Misc import CheckPcdDatum
+from Common.Misc import BuildOptionPcdValueFormat
from Common.BuildVersion import gBUILD_VERSION
from Common.MultipleWorkspace import MultipleWorkspace as mws
@@ -408,31 +409,6 @@ def CheckBuildOptionPcd():
GlobalData.BuildOptionPcd[i] = (TokenSpaceGuidCName, TokenCName, NewValue)
-def BuildOptionPcdValueFormat(TokenSpaceGuidCName, TokenCName, PcdDatumType, Value):
- if PcdDatumType == 'VOID*':
- if Value.startswith('L'):
- if not Value[1]:
- EdkLogger.error('GenFds', OPTION_VALUE_INVALID, 'For Void* type PCD, when specify the Value in the command line, please use the following format: "string", L"string", B"{...}"')
- Value = Value[0] + '"' + Value[1:] + '"'
- elif Value.startswith('B'):
- if not Value[1]:
- EdkLogger.error('GenFds', OPTION_VALUE_INVALID, 'For Void* type PCD, when specify the Value in the command line, please use the following format: "string", L"string", B"{...}"')
- Value = Value[1:]
- else:
- if not Value[0]:
- EdkLogger.error('GenFds', OPTION_VALUE_INVALID, 'For Void* type PCD, when specify the Value in the command line, please use the following format: "string", L"string", B"{...}"')
- Value = '"' + Value + '"'
-
- IsValid, Cause = CheckPcdDatum(PcdDatumType, Value)
- if not IsValid:
- EdkLogger.error('build', FORMAT_INVALID, Cause, ExtraData="%s.%s" % (TokenSpaceGuidCName, TokenCName))
- if PcdDatumType == 'BOOLEAN':
- Value = Value.upper()
- if Value == 'TRUE' or Value == '1':
- Value = '1'
- elif Value == 'FALSE' or Value == '0':
- Value = '0'
- return Value
## FindExtendTool()
#