BaseTools: refine CreateAsBuiltInf function

BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1932
ModuleAutogen.CreateAsBuiltInf IsOnlyCopy parameter
and related function can be moved out of CreateAsBuiltInf,
so that CreateAsBuiltInf is more clean.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Steven Shi <steven.shi@intel.com>
Cc: Christian Rodriguez <christian.rodriguez@intel.com>
Signed-off-by: Bob Feng <bob.c.feng@intel.com>
Reviewed-by: Steven Shi <steven.shi@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
This commit is contained in:
Bob Feng 2019-06-24 09:51:24 +08:00 committed by Feng, Bob C
parent 401507c786
commit dc174cd9e5
2 changed files with 5 additions and 6 deletions

View File

@ -3581,11 +3581,8 @@ class ModuleAutoGen(AutoGen):
## Create AsBuilt INF file the module
#
def CreateAsBuiltInf(self, IsOnlyCopy = False):
def CreateAsBuiltInf(self):
self.OutputFile = set()
if IsOnlyCopy and GlobalData.gBinCacheDest:
self.CopyModuleToCache()
return
if self.IsAsBuiltInfCreated:
return

View File

@ -2219,13 +2219,15 @@ class Build():
Module.CreateAsBuiltInf()
all_mod_set.add(Module)
for Module in self.HashSkipModules:
Module.CreateAsBuiltInf(True)
if GlobalData.gBinCacheDest:
Module.CopyModuleToCache()
all_mod_set.add(Module)
for Module in all_mod_set:
for lib in Module.LibraryAutoGenList:
all_lib_set.add(lib)
for lib in all_lib_set:
lib.CreateAsBuiltInf(True)
if GlobalData.gBinCacheDest:
lib.CopyModuleToCache()
all_lib_set.clear()
all_mod_set.clear()
self.BuildModules = []