diff options
author | Yonghong Zhu <yonghong.zhu@intel.com> | 2016-02-25 16:13:31 +0800 |
---|---|---|
committer | Yonghong Zhu <yonghong.zhu@intel.com> | 2016-03-16 10:35:52 +0800 |
commit | 763e8edf610b2ccf422986c81ee36b4733560cdb (patch) | |
tree | a573ad5457838675c3ff681cdf2fdf39d458de66 /BaseTools/Source/Python/build/build.py | |
parent | db27e9f3d8f007bf26bcb8907ecab5b5f1fb8f24 (diff) | |
download | edk2-platforms-763e8edf610b2ccf422986c81ee36b4733560cdb.tar.xz |
BaseTools: add new command line option to support override PCD value
this patch add new feature to support override PCD value on the command
line. The value from the command line is the highest priority.
1.Add option(--pcd) to support both PcdName and TokenSpaceGuild.PcdName
2.For void* type PCD, use following format:
cstring PCD: --pcd PcdName="string"
unicodestring PCD: --pcd PcdName=L"string"
CArray PCD: --pcd PcdName=B"{0x1, 0x2}"
3.Build Report, use *B to show the PCD value was overridden in the
command line.
4.Error Condition:
Report error if the PCD is not found
Report error if the PcdName is found under multiple different TokenSpaceGuid
Report error if PCD value syntax is incorrect
Report error if void* type PCD value exceed its max size
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/build/build.py')
-rw-r--r-- | BaseTools/Source/Python/build/build.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/BaseTools/Source/Python/build/build.py b/BaseTools/Source/Python/build/build.py index 23ca76e82c..5619638bd8 100644 --- a/BaseTools/Source/Python/build/build.py +++ b/BaseTools/Source/Python/build/build.py @@ -53,7 +53,7 @@ import Common.GlobalData as GlobalData # Version and Copyright
VersionNumber = "0.60" + ' ' + gBUILD_VERSION
__version__ = "%prog Version " + VersionNumber
-__copyright__ = "Copyright (c) 2007 - 2014, Intel Corporation All rights reserved."
+__copyright__ = "Copyright (c) 2007 - 2016, Intel Corporation All rights reserved."
## standard targets of build command
gSupportedTarget = ['all', 'genc', 'genmake', 'modules', 'libraries', 'fds', 'clean', 'cleanall', 'cleanlib', 'run']
@@ -747,6 +747,7 @@ class Build(): self.BuildReport = BuildReport(BuildOptions.ReportFile, BuildOptions.ReportType)
self.TargetTxt = TargetTxtClassObject()
self.ToolDef = ToolDefClassObject()
+ GlobalData.BuildOptionPcd = BuildOptions.OptionPcd
#Set global flag for build mode
GlobalData.gIgnoreSource = BuildOptions.IgnoreSources
@@ -1929,6 +1930,7 @@ def MyOptionParser(): Parser.add_option("--conf", action="store", type="string", dest="ConfDirectory", help="Specify the customized Conf directory.")
Parser.add_option("--check-usage", action="store_true", dest="CheckUsage", default=False, help="Check usage content of entries listed in INF file.")
Parser.add_option("--ignore-sources", action="store_true", dest="IgnoreSources", default=False, help="Focus to a binary build and ignore all source files")
+ Parser.add_option("--pcd", action="append", dest="OptionPcd", help="Set PCD value by command line. Format: 'PcdName=Value' ")
(Opt, Args) = Parser.parse_args()
return (Opt, Args)
|