Skip to content

Commit

Permalink
Fixed an issue which NULL library instance won't be built into the mo…
Browse files Browse the repository at this point in the history
…dule using it

git-svn-id: https://buildtools.tianocore.org/svn/buildtools/trunk/BaseTools@1288 7335b38e-4728-0410-8992-fb3ffe349368
  • Loading branch information
jwang36 committed Jul 25, 2008
1 parent c772874 commit a4f4e72
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions Source/Python/AutoGen/AutoGen.py
Expand Up @@ -763,16 +763,15 @@ def ValidModule(self, Module):
#
def ApplyLibraryInstance(self, Module):
ModuleType = Module.ModuleType
# apply library instances from platform
for LibraryClass in Module.LibraryClasses:
LibraryInstance = self.Platform.LibraryClasses[LibraryClass, ModuleType]
if LibraryInstance == None:
continue
Module.LibraryClasses[LibraryClass] = LibraryInstance

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

# add forced library instance
for LibraryClass in PlatformModule.LibraryClasses:
if LibraryClass.startswith("NULL"):
Module.LibraryClasses[LibraryClass] = PlatformModule.LibraryClasses[LibraryClass]

# R9 module
LibraryConsumerList = [Module]
Constructor = []
Expand All @@ -785,13 +784,13 @@ def ApplyLibraryInstance(self, Module):
M = LibraryConsumerList.pop()
for LibraryClassName in M.LibraryClasses:
if LibraryClassName not in LibraryInstance:
# overrided library instance for this module
# override 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 or LibraryPath == "":
LibraryPath = M.LibraryClasses[LibraryClassName]
if LibraryPath == None:
EdkLogger.error("build", RESOURCE_NOT_AVAILABLE,
"Instance of library class [%s] is not found" % LibraryClassName,
Expand Down Expand Up @@ -1401,8 +1400,8 @@ def _GetSourceFileList(self):
continue
# match tool chain family
if F.ToolChainFamily != "" and F.ToolChainFamily != ToolChainFamily:
EdkLogger.verbose("The file [%s] must be built by tools of [%s], "
"but current toolchain family is [%s]" % (SourceFile, F.ToolChainFamily, ToolChainFamily))
EdkLogger.debug(EdkLogger.DEBUG_0, "The file [%s] must be built by tools of [%s], "
"but current toolchain family is [%s]" % (SourceFile, F.ToolChainFamily, ToolChainFamily))
continue

# add the file path into search path list for file including
Expand Down

0 comments on commit a4f4e72

Please sign in to comment.