Skip to content

Commit

Permalink
Fixed library instance override issue
Browse files Browse the repository at this point in the history
git-svn-id: https://buildtools.tianocore.org/svn/buildtools/trunk/BaseTools@1278 7335b38e-4728-0410-8992-fb3ffe349368
  • Loading branch information
jwang36 committed Jul 7, 2008
1 parent 5fdd594 commit 3d8448d
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions Source/Python/AutoGen/AutoGen.py
Expand Up @@ -770,10 +770,8 @@ def ApplyLibraryInstance(self, Module):
continue
Module.LibraryClasses[LibraryClass] = LibraryInstance

# override library instances with module specific setting
# to override library instances with module specific setting
PlatformModule = self.Platform.Modules[str(Module)]
for LibraryClass in PlatformModule.LibraryClasses:
Module.LibraryClasses[LibraryClass] = PlatformModule.LibraryClasses[LibraryClass]

# R9 module
LibraryConsumerList = [Module]
Expand All @@ -786,14 +784,20 @@ def ApplyLibraryInstance(self, Module):
while len(LibraryConsumerList) > 0:
M = LibraryConsumerList.pop()
for LibraryClassName in M.LibraryClasses:
LibraryPath = M.LibraryClasses[LibraryClassName]
if LibraryPath == None or LibraryPath == "":
LibraryPath = self.Platform.LibraryClasses[LibraryClassName, ModuleType]
if LibraryPath == None:
EdkLogger.error("build", RESOURCE_NOT_AVAILABLE,
"Instance of library class [%s] is not found" % LibraryClassName,
File=self._MetaFile, ExtraData="consumed by [%s] [%s]" % (str(M), self.Arch))
if LibraryClassName not in LibraryInstance:
# overrided library instance for this module
if LibraryClassName in PlatformModule.LibraryClasses:
LibraryPath = PlatformModule.LibraryClasses[LibraryClassName]
else:
LibraryPath = M.LibraryClasses[LibraryClassName]
if LibraryPath == None or LibraryPath == "":
LibraryPath = self.Platform.LibraryClasses[LibraryClassName, ModuleType]
if LibraryPath == None:
EdkLogger.error("build", RESOURCE_NOT_AVAILABLE,
"Instance of library class [%s] is not found" % LibraryClassName,
File=self._MetaFile,
ExtraData="consumed by [%s] [%s]\n\t[%s]" % (str(M), self.Arch, str(Module)))

LibraryModule = self.BuildDatabase[LibraryPath, self.Arch]
# for those forced library instance (NULL library), add a fake library class
if LibraryClassName.startswith("NULL"):
Expand Down

0 comments on commit 3d8448d

Please sign in to comment.