From 83397f95f99b0884b27764f8ed13615a500e8fd7 Mon Sep 17 00:00:00 2001 From: Yonghong Zhu Date: Tue, 12 Dec 2017 15:18:22 +0800 Subject: BaseTools: back up the binary files when hash value is same V2: change to use InfBuildData but not ModuleAutoGen We meet the case that first build with --hash option, then build it again with --hash and --binary-destination option, since the hash value is same, tool will not build the driver again, it cause the binary files are not backed up. Cc: Liming Gao Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yonghong Zhu Reviewed-by: Liming Gao --- BaseTools/Source/Python/AutoGen/AutoGen.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'BaseTools/Source/Python/AutoGen/AutoGen.py') diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py b/BaseTools/Source/Python/AutoGen/AutoGen.py index 8ad385aac2..b00390ce7d 100644 --- a/BaseTools/Source/Python/AutoGen/AutoGen.py +++ b/BaseTools/Source/Python/AutoGen/AutoGen.py @@ -3838,7 +3838,13 @@ class ModuleAutoGen(AutoGen): ## Create AsBuilt INF file the module # - def CreateAsBuiltInf(self): + def CreateAsBuiltInf(self, IsOnlyCopy = False): + self.OutputFile = [] + if IsOnlyCopy: + if GlobalData.gBinCacheDest: + self.CopyModuleToCache() + return + if self.IsAsBuiltInfCreated: return @@ -3971,7 +3977,6 @@ class ModuleAutoGen(AutoGen): AsBuiltInfDict['module_pi_specification_version'] += [self.Specification['PI_SPECIFICATION_VERSION']] OutputDir = self.OutputDir.replace('\\', '/').strip('/') - self.OutputFile = [] for Item in self.CodaTargetList: File = Item.Target.Path.replace('\\', '/').strip('/').replace(OutputDir, '').strip('/') if File not in self.OutputFile: @@ -4198,8 +4203,12 @@ class ModuleAutoGen(AutoGen): shutil.copy2(HashFile, FileDir) if os.path.exists(ModuleFile): shutil.copy2(ModuleFile, FileDir) + if not self.OutputFile: + Ma = self.Workspace.BuildDatabase[PathClass(ModuleFile), self.Arch, self.BuildTarget, self.ToolChain] + self.OutputFile = Ma.Binaries if self.OutputFile: for File in self.OutputFile: + File = str(File) if not os.path.isabs(File): File = os.path.join(self.OutputDir, File) if os.path.exists(File): -- cgit v1.2.3