REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1231
Build system already support override PCD value by command
line so add this support to GenCfgOpt.py
Also update revision to 0.53
Test: Verified UPD header files generated can reflect different
PCD values from --pcd build command input
Cc: Jiewen Yao <Jiewen.yao@intel.com>
Cc: Gao Liming <liming.gao@intel.com>
Cc: Zhu Yonghong <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Chasel Chiu <chasel.chiu@intel.com>
Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com>
Reviewed-by: Zhu Yonghong <yonghong.zhu@intel.com>
+BuildOptionPcd = []\r
+\r
class CLogicalExpression:\r
def __init__(self):\r
self.index = 0\r
class CLogicalExpression:\r
def __init__(self):\r
self.index = 0\r
self._PcdsDict[Match.group(1)] = Match.group(2)\r
if self.Debug:\r
print "INFO : PCD %s = [ %s ]" % (Match.group(1), Match.group(2))\r
self._PcdsDict[Match.group(1)] = Match.group(2)\r
if self.Debug:\r
print "INFO : PCD %s = [ %s ]" % (Match.group(1), Match.group(2))\r
+ i = 0\r
+ while i < len(BuildOptionPcd):\r
+ Match = re.match("\s*([\w\.]+)\s*\=\s*(\w+)", BuildOptionPcd[i])\r
+ if Match:\r
+ self._PcdsDict[Match.group(1)] = Match.group(2)\r
+ i += 1\r
else:\r
Match = re.match("^\s*#\s+(!BSF|@Bsf|!HDR)\s+(.+)", DscLine)\r
if Match:\r
else:\r
Match = re.match("^\s*#\s+(!BSF|@Bsf|!HDR)\s+(.+)", DscLine)\r
if Match:\r
- print "GenCfgOpt Version 0.52"\r
+ print "GenCfgOpt Version 0.53"\r
print "Usage:"\r
print " GenCfgOpt UPDTXT PlatformDscFile BuildFvDir [-D Macros]"\r
print " GenCfgOpt HEADER PlatformDscFile BuildFvDir InputHFile [-D Macros]"\r
print "Usage:"\r
print " GenCfgOpt UPDTXT PlatformDscFile BuildFvDir [-D Macros]"\r
print " GenCfgOpt HEADER PlatformDscFile BuildFvDir InputHFile [-D Macros]"\r
#\r
# Parse the options and args\r
#\r
#\r
# Parse the options and args\r
#\r
GenCfgOpt = CGenCfgOpt()\r
GenCfgOpt = CGenCfgOpt()\r
+ while i < len(sys.argv):\r
+ if sys.argv[i].strip().lower() == "--pcd":\r
+ BuildOptionPcd.append(sys.argv[i+1])\r
+ i += 1\r
+ i += 1\r
argc = len(sys.argv)\r
if argc < 4:\r
Usage()\r
argc = len(sys.argv)\r
if argc < 4:\r
Usage()\r