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:
Feng, Bob C
2019-04-13 16:02:02 +08:00
parent 4b1b7c1913
commit db01c8e3d8
8 changed files with 62 additions and 96 deletions

View File

@ -146,6 +146,8 @@ def TargetTxtDict(ConfDir):
Target.LoadTargetTxtFile(os.path.normpath(os.path.join(ConfDir, gDefaultTargetTxtFile)))
return Target
TargetTxt = TargetTxtDict(os.path.join(os.getenv("WORKSPACE"),"Conf"))
##
#
# This acts like the main() function for the script, unless it is 'import'ed into another