]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/Workspace/WorkspaceCommon.py
BaseTools: Various typo
[mirror_edk2.git] / BaseTools / Source / Python / Workspace / WorkspaceCommon.py
index 8d8a3e278987ee64f5fe0d3eb5ee32709730d0d4..b79280bc2e839c754eb5a83a69c9997212f93a50 100644 (file)
@@ -90,10 +90,7 @@ def GetDeclaredPcd(Platform, BuildDatabase, Arch, Target, Toolchain, additionalP
 #  @retval: List of dependent libraries which are InfBuildData instances\r
 #\r
 def GetLiabraryInstances(Module, Platform, BuildDatabase, Arch, Target, Toolchain):\r
-    if Module.AutoGenVersion >= 0x00010005:\r
-        return GetModuleLibInstances(Module, Platform, BuildDatabase, Arch, Target, Toolchain)\r
-    else:\r
-        return _ResolveLibraryReference(Module, Platform)\r
+    return GetModuleLibInstances(Module, Platform, BuildDatabase, Arch, Target, Toolchain)\r
 \r
 def GetModuleLibInstances(Module, Platform, BuildDatabase, Arch, Target, Toolchain, FileName = '', EdkLogger = None):\r
     ModuleType = Module.ModuleType\r
@@ -128,13 +125,10 @@ def GetModuleLibInstances(Module, Platform, BuildDatabase, Arch, Target, Toolcha
         for LibraryClassName in M.LibraryClasses:\r
             if LibraryClassName not in LibraryInstance:\r
                 # override library instance for this module\r
-                if LibraryClassName in Platform.Modules[str(Module)].LibraryClasses:\r
-                    LibraryPath = Platform.Modules[str(Module)].LibraryClasses[LibraryClassName]\r
-                else:\r
-                    LibraryPath = Platform.LibraryClasses[LibraryClassName, ModuleType]\r
-                if LibraryPath is None or LibraryPath == "":\r
-                    LibraryPath = M.LibraryClasses[LibraryClassName]\r
-                    if LibraryPath is None or LibraryPath == "":\r
+                LibraryPath = Platform.Modules[str(Module)].LibraryClasses.get(LibraryClassName,Platform.LibraryClasses[LibraryClassName, ModuleType])\r
+                if LibraryPath is None:\r
+                    LibraryPath = M.LibraryClasses.get(LibraryClassName)\r
+                    if LibraryPath is None:\r
                         if FileName:\r
                             EdkLogger.error("build", RESOURCE_NOT_AVAILABLE,\r
                                             "Instance of library class [%s] is not found" % LibraryClassName,\r
@@ -253,32 +247,8 @@ def GetModuleLibInstances(Module, Platform, BuildDatabase, Arch, Target, Toolcha
             SortedLibraryList.append(Item)\r
 \r
     #\r
-    # Build the list of constructor and destructir names\r
+    # Build the list of constructor and destructor names\r
     # The DAG Topo sort produces the destructor order, so the list of constructors must generated in the reverse order\r
     #\r
     SortedLibraryList.reverse()\r
     return SortedLibraryList\r
-\r
-def _ResolveLibraryReference(Module, Platform):\r
-    LibraryConsumerList = [Module]\r
-\r
-    # "CompilerStub" is a must for Edk modules\r
-    if Module.Libraries:\r
-        Module.Libraries.append("CompilerStub")\r
-    LibraryList = []\r
-    while len(LibraryConsumerList) > 0:\r
-        M = LibraryConsumerList.pop()\r
-        for LibraryName in M.Libraries:\r
-            Library = Platform.LibraryClasses[LibraryName, ':dummy:']\r
-            if Library is None:\r
-                for Key in Platform.LibraryClasses.data:\r
-                    if LibraryName.upper() == Key.upper():\r
-                        Library = Platform.LibraryClasses[Key, ':dummy:']\r
-                        break\r
-                if Library is None:\r
-                    continue\r
-\r
-            if Library not in LibraryList:\r
-                LibraryList.append(Library)\r
-                LibraryConsumerList.append(Library)\r
-    return LibraryList\r