diff options
author | lgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524> | 2012-04-10 07:18:20 +0000 |
---|---|---|
committer | lgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524> | 2012-04-10 07:18:20 +0000 |
commit | 64b2609fcff9d6412eea4c74c8e74bed33dc3235 (patch) | |
tree | b2fa2c1493272b91a04ff4f12384f3ceaa23f1a7 /BaseTools/Source/Python/build/build.py | |
parent | 09e4dbeb5c0ef7d9e178e81f73c9e43f8ef48559 (diff) | |
download | edk2-platforms-64b2609fcff9d6412eea4c74c8e74bed33dc3235.tar.xz |
Sync BaseTools Trunk (version r2518) to EDKII main trunk.
Signed-off-by: Liming Gao <liming.gao@intel.com>
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13178 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'BaseTools/Source/Python/build/build.py')
-rw-r--r-- | BaseTools/Source/Python/build/build.py | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/BaseTools/Source/Python/build/build.py b/BaseTools/Source/Python/build/build.py index ef52162ea1..a463c527be 100644 --- a/BaseTools/Source/Python/build/build.py +++ b/BaseTools/Source/Python/build/build.py @@ -59,6 +59,9 @@ gBuildConfiguration = "Conf/target.txt" gBuildCacheDir = "Conf/.cache"
gToolsDefinition = "Conf/tools_def.txt"
+TemporaryTablePattern = re.compile(r'^_\d+_\d+_[a-fA-F0-9]+$')
+TmpTableDict = {}
+
## Check environment PATH variable to make sure the specified tool is found
#
# If the tool is found in the PATH, then True is returned
@@ -1449,6 +1452,14 @@ class Build(): EdkLogger.error("build", BUILD_ERROR, "Failed to build module", ExtraData=GlobalData.gBuildingModule)
#
+ # Save temp tables to a TmpTableDict.
+ #
+ for Key in Wa.BuildDatabase._CACHE_:
+ if Wa.BuildDatabase._CACHE_[Key]._RawData and Wa.BuildDatabase._CACHE_[Key]._RawData._Table and Wa.BuildDatabase._CACHE_[Key]._RawData._Table.Table:
+ if TemporaryTablePattern.match(Wa.BuildDatabase._CACHE_[Key]._RawData._Table.Table):
+ TmpTableDict[Wa.BuildDatabase._CACHE_[Key]._RawData._Table.Table] = Wa.BuildDatabase._CACHE_[Key]._RawData._Table.Cur
+ #
+ #
# All modules have been put in build tasks queue. Tell task scheduler
# to exit if all tasks are completed
#
@@ -1651,8 +1662,8 @@ def MyOptionParser(): help="Build the platform specified by the DSC file name argument, overriding target.txt's ACTIVE_PLATFORM definition.")
Parser.add_option("-m", "--module", action="callback", type="string", dest="ModuleFile", callback=SingleCheckCallback,
help="Build the module specified by the INF file name argument.")
- Parser.add_option("-b", "--buildtarget", action="append", type="choice", choices=['DEBUG','RELEASE','NOOPT'], dest="BuildTarget",
- help="BuildTarget is one of list: DEBUG, RELEASE, NOOPT, which overrides target.txt's TARGET definition. To specify more TARGET, please repeat this option.")
+ Parser.add_option("-b", "--buildtarget", type="string", dest="BuildTarget", help="Using the TARGET to build the platform, overriding target.txt's TARGET definition.",
+ action="append")
Parser.add_option("-t", "--tagname", action="append", type="string", dest="ToolChain",
help="Using the Tool Chain Tagname to build the platform, overriding target.txt's TOOL_CHAIN_TAG definition.")
Parser.add_option("-x", "--sku-id", action="callback", type="string", dest="SkuId", callback=SingleCheckCallback,
@@ -1809,7 +1820,12 @@ def Main(): EdkLogger.error("build", OPTION_VALUE_INVALID, "UNI flag must be one of -c or -s")
MyBuild = Build(Target, Workspace, Option)
+ GlobalData.gCommandLineDefines['ARCH'] = ' '.join(MyBuild.ArchList)
MyBuild.Launch()
+ # Drop temp tables to avoid database locked.
+ for TmpTableName in TmpTableDict:
+ SqlCommand = """drop table IF EXISTS %s""" % TmpTableName
+ TmpTableDict[TmpTableName].execute(SqlCommand)
#MyBuild.DumpBuildData()
except FatalError, X:
if MyBuild != None:
|