From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.136, mailfrom: bob.c.feng@intel.com) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by groups.io with SMTP; Sun, 23 Jun 2019 18:51:28 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 23 Jun 2019 18:51:27 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.63,410,1557212400"; d="scan'208";a="166186661" Received: from shwdepsi1121.ccr.corp.intel.com ([10.239.158.47]) by orsmga006.jf.intel.com with ESMTP; 23 Jun 2019 18:51:26 -0700 From: "Bob Feng" To: devel@edk2.groups.io Cc: Liming Gao , Steven Shi , Christian Rodriguez , Bob Feng Subject: [Patch 1/2] BaseTools: refine CreateAsBuiltInf function Date: Mon, 24 Jun 2019 09:51:24 +0800 Message-Id: <20190624015124.16544-1-bob.c.feng@intel.com> X-Mailer: git-send-email 2.20.1.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 Cc: Steven Shi Cc: Christian Rodriguez Signed-off-by: Bob Feng --- BaseTools/Source/Python/AutoGen/AutoGen.py | 5 +---- BaseTools/Source/Python/build/build.py | 6 ++++-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py b/BaseTools/Source/Python/AutoGen/AutoGen.py index f50941d422..45b81ed660 100644 --- a/BaseTools/Source/Python/AutoGen/AutoGen.py +++ b/BaseTools/Source/Python/AutoGen/AutoGen.py @@ -3579,15 +3579,12 @@ class ModuleAutoGen(AutoGen): fInputfile.close () return OutputName ## 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 # Skip INF file generation for libraries diff --git a/BaseTools/Source/Python/build/build.py b/BaseTools/Source/Python/build/build.py index 2dca3c7b34..3ece4d4c61 100644 --- a/BaseTools/Source/Python/build/build.py +++ b/BaseTools/Source/Python/build/build.py @@ -2217,17 +2217,19 @@ class Build(): all_mod_set = set() for Module in self.BuildModules: 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 = [] self.HashSkipModules = [] ## Do some clean-up works when error occurred -- 2.20.1.windows.1