git-svn-id: https://buildtools.tianocore.org/svn/buildtools/trunk/BaseTools@521 7335b...
authorhche10x <hche10x@7335b38e-4728-0410-8992-fb3ffe349368>
Wed, 8 Aug 2007 07:52:30 +0000 (07:52 +0000)
committerhche10x <hche10x@7335b38e-4728-0410-8992-fb3ffe349368>
Wed, 8 Aug 2007 07:52:30 +0000 (07:52 +0000)
Source/Python/Common/EdkIIWorkspaceBuild.py

index 2ba0576..f9639a6 100644 (file)
@@ -283,8 +283,9 @@ class WorkspaceBuild(object):
                   \r
                 # LibraryClass\r
                 for Item in Platform.LibraryClasses.LibraryList:\r
+                    SupModuleList = self.FindSupModuleListOfLibraryClass(Item.Name, NormPath(Item.FilePath))\r
                     if Arch in Item.SupArchList:\r
-                        for ModuleType in Item.ModuleType:\r
+                        for ModuleType in SupModuleList:\r
                             pb.LibraryClasses[(Item.Name, ModuleType)] = NormPath(Item.FilePath)\r
                     \r
                 # Pcds\r
@@ -370,6 +371,10 @@ class WorkspaceBuild(object):
             Module = self.InfDatabase[Inf].Module\r
             \r
             for Arch in self.SupArchList:\r
+                if not self.IsModuleDefinedInPlatform(Inf, Arch):\r
+                    pass\r
+                    #break\r
+                \r
                 pb = ModuleBuildClassObject()\r
                 \r
                 # Defines\r
@@ -839,7 +844,28 @@ class WorkspaceBuild(object):
         if Guid in PcdsSet.keys():\r
             Value = PcdsSet[Guid]\r
         \r
-        return PcdClassObject(Name, Guid, Type, DatumType, Value, Token, MaxDatumSize, SkuInfoList)   \r
+        return PcdClassObject(Name, Guid, Type, DatumType, Value, Token, MaxDatumSize, SkuInfoList)\r
+    \r
+    #\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
+        \r
+        return []\r
+    \r
+    #\r
+    # Check if the module is defined in <Compentent> of <Platform>\r
+    #\r
+    def IsModuleDefinedInPlatform(self, Inf, Arch):\r
+        for Dsc in self.DscDatabase.values():\r
+            for Module in Dsc.Platform.Modules.ModuleList:\r
+                if Inf == Module.Name and Arch in Module.SupArchList:\r
+                    return True\r
+        return False\r
 \r
     #\r
     # Show all content of the workspacebuild\r