fix a bug for the libraryclass which is defined in specific moduletype is override...
authorhche10x <hche10x@7335b38e-4728-0410-8992-fb3ffe349368>
Thu, 9 Aug 2007 08:52:10 +0000 (08:52 +0000)
committerhche10x <hche10x@7335b38e-4728-0410-8992-fb3ffe349368>
Thu, 9 Aug 2007 08:52:10 +0000 (08:52 +0000)
git-svn-id: https://buildtools.tianocore.org/svn/buildtools/trunk/BaseTools@536 7335b38e-4728-0410-8992-fb3ffe349368

Source/Python/Common/EdkIIWorkspaceBuild.py

index f7283d0..ec0cfa5 100644 (file)
@@ -14,7 +14,7 @@
 #\r
 # Import Modules\r
 #\r
-import os, string, copy, pdb\r
+import os, string, copy, pdb, copy\r
 import EdkLogger\r
 import DataType\r
 from InfClassObject import *\r
@@ -283,7 +283,7 @@ class WorkspaceBuild(object):
                   \r
                 # LibraryClass\r
                 for Item in Platform.LibraryClasses.LibraryList:\r
-                    SupModuleList = self.FindSupModuleListOfLibraryClass(Item.Name, NormPath(Item.FilePath))\r
+                    SupModuleList = self.FindSupModuleListOfLibraryClass(Item, Platform.LibraryClasses.LibraryList)\r
                     if Arch in Item.SupArchList:\r
                         for ModuleType in SupModuleList:\r
                             pb.LibraryClasses[(Item.Name, ModuleType)] = NormPath(Item.FilePath)\r
@@ -860,13 +860,25 @@ class WorkspaceBuild(object):
     #\r
     # Search in InfDatabase, find the supmodulelist of the libraryclass\r
     #\r
-    def FindSupModuleListOfLibraryClass(self, Name, FilePath):\r
-        LibraryClassList = self.InfDatabase[FilePath].Module.Header.LibraryClass\r
-        for Item in LibraryClassList:\r
-            if Item.LibraryClass == Name:\r
-                return Item.SupModuleList\r
+    def FindSupModuleListOfLibraryClass(self, LibraryClass, OverridedLibraryClassList):\r
+        Name = LibraryClass.Name\r
+        FilePath = NormPath(LibraryClass.FilePath)\r
+        SupModuleList = copy.copy(LibraryClass.ModuleType)\r
         \r
-        return []\r
+        #\r
+        # If the SupModuleList means all, remove overrided module types of platform\r
+        #\r
+        if SupModuleList == DataType.SUP_MODULE_LIST:\r
+            EdkLogger.debug(EdkLogger.DEBUG_3, "\tLibraryClass %s supports all module types" % Name)\r
+            for Item in OverridedLibraryClassList:\r
+                if Item.Name == Name:\r
+                    if Item.ModuleType == DataType.SUP_MODULE_LIST:\r
+                        continue\r
+                    for ModuleType in Item.ModuleType:\r
+                        EdkLogger.debug(EdkLogger.DEBUG_3, "\tLibraryClass %s has specific defined module types" % Name)\r
+                        SupModuleList.remove(ModuleType)\r
+\r
+        return SupModuleList\r
     \r
     #\r
     # Check if the module is defined in <Compentent> of <Platform>\r