gBuildCacheDir = "Conf/.cache"\r
gToolsDefinition = "Conf/tools_def.txt"\r
\r
+TemporaryTablePattern = re.compile(r'^_\d+_\d+_[a-fA-F0-9]+$')\r
+TmpTableDict = {}\r
+\r
## Check environment PATH variable to make sure the specified tool is found\r
#\r
# If the tool is found in the PATH, then True is returned\r
if BuildTask.HasError():\r
EdkLogger.error("build", BUILD_ERROR, "Failed to build module", ExtraData=GlobalData.gBuildingModule)\r
\r
+ #\r
+ # Save temp tables to a TmpTableDict.\r
+ #\r
+ for Key in Wa.BuildDatabase._CACHE_:\r
+ if Wa.BuildDatabase._CACHE_[Key]._RawData and Wa.BuildDatabase._CACHE_[Key]._RawData._Table and Wa.BuildDatabase._CACHE_[Key]._RawData._Table.Table:\r
+ if TemporaryTablePattern.match(Wa.BuildDatabase._CACHE_[Key]._RawData._Table.Table):\r
+ TmpTableDict[Wa.BuildDatabase._CACHE_[Key]._RawData._Table.Table] = Wa.BuildDatabase._CACHE_[Key]._RawData._Table.Cur\r
+ #\r
#\r
# All modules have been put in build tasks queue. Tell task scheduler\r
# to exit if all tasks are completed\r
help="Build the platform specified by the DSC file name argument, overriding target.txt's ACTIVE_PLATFORM definition.")\r
Parser.add_option("-m", "--module", action="callback", type="string", dest="ModuleFile", callback=SingleCheckCallback,\r
help="Build the module specified by the INF file name argument.")\r
- Parser.add_option("-b", "--buildtarget", action="append", type="choice", choices=['DEBUG','RELEASE','NOOPT'], dest="BuildTarget",\r
- help="BuildTarget is one of list: DEBUG, RELEASE, NOOPT, which overrides target.txt's TARGET definition. To specify more TARGET, please repeat this option.")\r
+ Parser.add_option("-b", "--buildtarget", type="string", dest="BuildTarget", help="Using the TARGET to build the platform, overriding target.txt's TARGET definition.",\r
+ action="append")\r
Parser.add_option("-t", "--tagname", action="append", type="string", dest="ToolChain",\r
help="Using the Tool Chain Tagname to build the platform, overriding target.txt's TOOL_CHAIN_TAG definition.")\r
Parser.add_option("-x", "--sku-id", action="callback", type="string", dest="SkuId", callback=SingleCheckCallback,\r
EdkLogger.error("build", OPTION_VALUE_INVALID, "UNI flag must be one of -c or -s")\r
\r
MyBuild = Build(Target, Workspace, Option)\r
+ GlobalData.gCommandLineDefines['ARCH'] = ' '.join(MyBuild.ArchList)\r
MyBuild.Launch()\r
+ # Drop temp tables to avoid database locked.\r
+ for TmpTableName in TmpTableDict:\r
+ SqlCommand = """drop table IF EXISTS %s""" % TmpTableName\r
+ TmpTableDict[TmpTableName].execute(SqlCommand)\r
#MyBuild.DumpBuildData()\r
except FatalError, X:\r
if MyBuild != None:\r