diff options
author | Christian Rodriguez <christian.rodriguez@intel.com> | 2019-04-05 00:04:23 +0800 |
---|---|---|
committer | Feng, Bob C <bob.c.feng@intel.com> | 2019-04-10 13:32:14 +0800 |
commit | db4d47fd3ae9cb4a80399b7ea4cfd55f1b22d180 (patch) | |
tree | 54fe64200a80b2b3a16b28e341319229e3abbcbf /BaseTools/Source/Python | |
parent | f2b5e04acad2bac7f11d97871cc68e8a0d312289 (diff) | |
download | edk2-db4d47fd3ae9cb4a80399b7ea4cfd55f1b22d180.tar.gz edk2-db4d47fd3ae9cb4a80399b7ea4cfd55f1b22d180.tar.bz2 edk2-db4d47fd3ae9cb4a80399b7ea4cfd55f1b22d180.zip |
BaseTools: Fix corner-cases of --hash feature
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1680
Re-use libraries, since they have already been hashed.
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Christian Rodriguez <christian.rodriguez@intel.com>
Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
Diffstat (limited to 'BaseTools/Source/Python')
-rw-r--r-- | BaseTools/Source/Python/AutoGen/GenMake.py | 6 | ||||
-rw-r--r-- | BaseTools/Source/Python/build/build.py | 14 |
2 files changed, 16 insertions, 4 deletions
diff --git a/BaseTools/Source/Python/AutoGen/GenMake.py b/BaseTools/Source/Python/AutoGen/GenMake.py index ed2368f6a3..1091366190 100644 --- a/BaseTools/Source/Python/AutoGen/GenMake.py +++ b/BaseTools/Source/Python/AutoGen/GenMake.py @@ -977,7 +977,7 @@ cleanlib: ## For creating makefile targets for dependent libraries
def ProcessDependentLibrary(self):
for LibraryAutoGen in self._AutoGenObject.LibraryAutoGenList:
- if not LibraryAutoGen.IsBinaryModule:
+ if not LibraryAutoGen.IsBinaryModule and not LibraryAutoGen.CanSkipbyHash():
self.LibraryBuildDirectoryList.append(self.PlaceMacro(LibraryAutoGen.BuildDir, self.Macros))
## Return a list containing source file's dependencies
@@ -1480,7 +1480,7 @@ cleanlib: def GetLibraryBuildDirectoryList(self):
DirList = []
for LibraryAutoGen in self._AutoGenObject.LibraryAutoGenList:
- if not LibraryAutoGen.IsBinaryModule:
+ if not LibraryAutoGen.IsBinaryModule and not LibraryAutoGen.CanSkipbyHash():
DirList.append(os.path.join(self._AutoGenObject.BuildDir, LibraryAutoGen.BuildDir))
return DirList
@@ -1616,7 +1616,7 @@ class TopLevelMakefile(BuildFile): def GetLibraryBuildDirectoryList(self):
DirList = []
for LibraryAutoGen in self._AutoGenObject.LibraryAutoGenList:
- if not LibraryAutoGen.IsBinaryModule:
+ if not LibraryAutoGen.IsBinaryModule and not LibraryAutoGen.CanSkipbyHash():
DirList.append(os.path.join(self._AutoGenObject.BuildDir, LibraryAutoGen.BuildDir))
return DirList
diff --git a/BaseTools/Source/Python/build/build.py b/BaseTools/Source/Python/build/build.py index 9e6e5c15b2..af8bba47b1 100644 --- a/BaseTools/Source/Python/build/build.py +++ b/BaseTools/Source/Python/build/build.py @@ -1769,7 +1769,8 @@ class Build(): for Module in Pa.Platform.Modules:
if self.ModuleFile.Dir == Module.Dir and self.ModuleFile.Name == Module.Name:
Ma = ModuleAutoGen(Wa, Module, BuildTarget, ToolChain, Arch, self.PlatformFile)
- if Ma is None: continue
+ if Ma is None:
+ continue
MaList.append(Ma)
if Ma.CanSkipbyHash():
self.HashSkipModules.append(Ma)
@@ -2143,10 +2144,21 @@ class Build(): RemoveDirectory(os.path.dirname(GlobalData.gDatabasePath), True)
def CreateAsBuiltInf(self):
+ all_lib_set = set()
+ all_mod_set = set()
for Module in self.BuildModules:
Module.CreateAsBuiltInf()
+ all_mod_set.add(Module)
for Module in self.HashSkipModules:
Module.CreateAsBuiltInf(True)
+ 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)
+ all_lib_set.clear()
+ all_mod_set.clear()
self.BuildModules = []
self.HashSkipModules = []
## Do some clean-up works when error occurred
|