if HasTokenSpace:\r
if (PcdItem.TokenCName, PcdItem.TokenSpaceGuidCName) == (TokenCName, TokenSpaceGuidCName):\r
PcdDatumType = PcdItem.DatumType\r
- NewValue = self._BuildOptionPcdValueFormat(TokenSpaceGuidCName, TokenCName, PcdDatumType, pcdvalue)\r
+ NewValue = BuildOptionPcdValueFormat(TokenSpaceGuidCName, TokenCName, PcdDatumType, pcdvalue)\r
FoundFlag = True\r
else:\r
if PcdItem.TokenCName == TokenCName:\r
TokenSpaceGuidCNameList.append(PcdItem.TokenSpaceGuidCName)\r
PcdDatumType = PcdItem.DatumType\r
TokenSpaceGuidCName = PcdItem.TokenSpaceGuidCName\r
- NewValue = self._BuildOptionPcdValueFormat(TokenSpaceGuidCName, TokenCName, PcdDatumType, pcdvalue)\r
+ NewValue = BuildOptionPcdValueFormat(TokenSpaceGuidCName, TokenCName, PcdDatumType, pcdvalue)\r
FoundFlag = True\r
else:\r
EdkLogger.error(\r
print >> file, f\r
return True\r
\r
- def _BuildOptionPcdValueFormat(self, TokenSpaceGuidCName, TokenCName, PcdDatumType, Value):\r
- if PcdDatumType == 'VOID*':\r
- if Value.startswith('L'):\r
- if not Value[1]:\r
- EdkLogger.error('build', OPTION_VALUE_INVALID, 'For Void* type PCD, when specify the Value in the command line, please use the following format: "string", L"string", B"{...}"')\r
- Value = Value[0] + '"' + Value[1:] + '"'\r
- elif Value.startswith('B'):\r
- if not Value[1]:\r
- EdkLogger.error('build', OPTION_VALUE_INVALID, 'For Void* type PCD, when specify the Value in the command line, please use the following format: "string", L"string", B"{...}"')\r
- Value = Value[1:]\r
- else:\r
- if not Value[0]:\r
- EdkLogger.error('build', OPTION_VALUE_INVALID, 'For Void* type PCD, when specify the Value in the command line, please use the following format: "string", L"string", B"{...}"')\r
- Value = '"' + Value + '"'\r
-\r
- IsValid, Cause = CheckPcdDatum(PcdDatumType, Value)\r
- if not IsValid:\r
- EdkLogger.error('build', FORMAT_INVALID, Cause, ExtraData="%s.%s" % (TokenSpaceGuidCName, TokenCName))\r
- if PcdDatumType == 'BOOLEAN':\r
- Value = Value.upper()\r
- if Value == 'TRUE' or Value == '1':\r
- Value = '1'\r
- elif Value == 'FALSE' or Value == '0':\r
- Value = '0'\r
- return Value\r
\r
def _GetMetaFiles(self, Target, Toolchain, Arch):\r
AllWorkSpaceMetaFiles = set()\r
## @file\r
# Create makefile for MS nmake and GNU make\r
#\r
-# Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.<BR>\r
# This program and the accompanying materials\r
# are licensed and made available under the terms and conditions of the BSD License\r
# which accompanies this distribution. The full text of the license may be found at\r
if GlobalData.BuildOptionPcd:\r
for index, option in enumerate(GlobalData.gCommand):\r
if "--pcd" == option and GlobalData.gCommand[index+1]:\r
- ExtraOption += " --pcd " + GlobalData.gCommand[index+1]\r
+ pcdName, pcdValue = GlobalData.gCommand[index+1].split('=')\r
+ if pcdValue.startswith('H'):\r
+ pcdValue = 'H' + '"' + pcdValue[1:] + '"'\r
+ ExtraOption += " --pcd " + pcdName + '=' + pcdValue\r
+ elif pcdValue.startswith('L'):\r
+ pcdValue = 'L' + '"' + pcdValue[1:] + '"'\r
+ ExtraOption += " --pcd " + pcdName + '=' + pcdValue\r
+ else:\r
+ ExtraOption += " --pcd " + GlobalData.gCommand[index+1]\r
\r
MakefileName = self._FILE_NAME_[self._FileType]\r
SubBuildCommandList = []\r
int(Guid[4][-2:], 16)\r
)\r
\r
+def BuildOptionPcdValueFormat(TokenSpaceGuidCName, TokenCName, PcdDatumType, Value):\r
+ if PcdDatumType == 'VOID*':\r
+ if Value.startswith('L'):\r
+ if not Value[1]:\r
+ EdkLogger.error("build", FORMAT_INVALID, 'For Void* type PCD, when specify the Value in the command line, please use the following format: "string", L"string", H"{...}"')\r
+ Value = Value[0] + '"' + Value[1:] + '"'\r
+ elif Value.startswith('H'):\r
+ if not Value[1]:\r
+ EdkLogger.error("build", FORMAT_INVALID, 'For Void* type PCD, when specify the Value in the command line, please use the following format: "string", L"string", H"{...}"')\r
+ Value = Value[1:]\r
+ else:\r
+ if not Value[0]:\r
+ EdkLogger.error("build", FORMAT_INVALID, 'For Void* type PCD, when specify the Value in the command line, please use the following format: "string", L"string", H"{...}"')\r
+ Value = '"' + Value + '"'\r
+\r
+ IsValid, Cause = CheckPcdDatum(PcdDatumType, Value)\r
+ if not IsValid:\r
+ EdkLogger.error("build", FORMAT_INVALID, Cause, ExtraData="%s.%s" % (TokenSpaceGuidCName, TokenCName))\r
+ if PcdDatumType == 'BOOLEAN':\r
+ Value = Value.upper()\r
+ if Value == 'TRUE' or Value == '1':\r
+ Value = '1'\r
+ elif Value == 'FALSE' or Value == '0':\r
+ Value = '0'\r
+ return Value\r
+\r
##\r
#\r
# This acts like the main() function for the script, unless it is 'import'ed into another\r
from Common.Misc import ClearDuplicatedInf\r
from Common.Misc import GuidStructureStringToGuidString\r
from Common.Misc import CheckPcdDatum\r
+from Common.Misc import BuildOptionPcdValueFormat\r
from Common.BuildVersion import gBUILD_VERSION\r
from Common.MultipleWorkspace import MultipleWorkspace as mws\r
\r
\r
GlobalData.BuildOptionPcd[i] = (TokenSpaceGuidCName, TokenCName, NewValue)\r
\r
-def BuildOptionPcdValueFormat(TokenSpaceGuidCName, TokenCName, PcdDatumType, Value):\r
- if PcdDatumType == 'VOID*':\r
- if Value.startswith('L'):\r
- if not Value[1]:\r
- 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"{...}"')\r
- Value = Value[0] + '"' + Value[1:] + '"'\r
- elif Value.startswith('B'):\r
- if not Value[1]:\r
- 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"{...}"')\r
- Value = Value[1:]\r
- else:\r
- if not Value[0]:\r
- 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"{...}"')\r
- Value = '"' + Value + '"'\r
-\r
- IsValid, Cause = CheckPcdDatum(PcdDatumType, Value)\r
- if not IsValid:\r
- EdkLogger.error('build', FORMAT_INVALID, Cause, ExtraData="%s.%s" % (TokenSpaceGuidCName, TokenCName))\r
- if PcdDatumType == 'BOOLEAN':\r
- Value = Value.upper()\r
- if Value == 'TRUE' or Value == '1':\r
- Value = '1'\r
- elif Value == 'FALSE' or Value == '0':\r
- Value = '0'\r
- return Value\r
\r
## FindExtendTool()\r
#\r