BaseTools: Singleton the object to handle build conf file
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1875 The build config files are target.txt, build rule, tooldef During a build, the config is not changed, so the object to handle them need to be singleton. Cc: Liming Gao <liming.gao@intel.com> Signed-off-by: Bob Feng <bob.c.feng@intel.com> Acked-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Laszlo Ersek <lersek@redhat.com> Acked-by: Liming Gao <liming.gao@intel.com>
This commit is contained in:
@ -14,7 +14,7 @@ import re
|
||||
from . import EdkLogger
|
||||
|
||||
from .BuildToolError import *
|
||||
from Common.TargetTxtClassObject import TargetTxtDict
|
||||
from Common.TargetTxtClassObject import TargetTxt
|
||||
from Common.LongFilePathSupport import OpenLongFilePath as open
|
||||
from Common.Misc import PathClass
|
||||
from Common.StringUtils import NormPath
|
||||
@ -263,7 +263,7 @@ class ToolDefClassObject(object):
|
||||
# @retval ToolDef An instance of ToolDefClassObject() with loaded tools_def.txt
|
||||
#
|
||||
def ToolDefDict(ConfDir):
|
||||
Target = TargetTxtDict(ConfDir)
|
||||
Target = TargetTxt
|
||||
ToolDef = ToolDefClassObject()
|
||||
if TAB_TAT_DEFINES_TOOL_CHAIN_CONF in Target.TargetTxtDictionary:
|
||||
ToolsDefFile = Target.TargetTxtDictionary[TAB_TAT_DEFINES_TOOL_CHAIN_CONF]
|
||||
@ -275,6 +275,8 @@ def ToolDefDict(ConfDir):
|
||||
ToolDef.LoadToolDefFile(os.path.normpath(os.path.join(ConfDir, gDefaultToolsDefFile)))
|
||||
return ToolDef
|
||||
|
||||
ToolDef = ToolDefDict((os.path.join(os.getenv("WORKSPACE"),"Conf")))
|
||||
|
||||
##
|
||||
#
|
||||
# This acts like the main() function for the script, unless it is 'import'ed into another
|
||||
|
Reference in New Issue
Block a user