Fix a bug about overriding mechanism of Library instances in DSC
authorhche10x <hche10x@7335b38e-4728-0410-8992-fb3ffe349368>
Tue, 14 Aug 2007 09:05:13 +0000 (09:05 +0000)
committerhche10x <hche10x@7335b38e-4728-0410-8992-fb3ffe349368>
Tue, 14 Aug 2007 09:05:13 +0000 (09:05 +0000)
git-svn-id: https://buildtools.tianocore.org/svn/buildtools/trunk/BaseTools@567 7335b38e-4728-0410-8992-fb3ffe349368

Source/Python/Common/EdkIIWorkspaceBuild.py

index 9392854..b2b29ee 100644 (file)
@@ -889,13 +889,27 @@ class WorkspaceBuild(object):
         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
+                #\r
+                # Find a library class with the same name\r
+                #\r
                 if Item.Name == Name:\r
+                    #\r
+                    # Do nothing if it is itself\r
+                    #\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
-                        if ModuleType in SupModuleList:\r
-                            SupModuleList.remove(ModuleType)\r
+                    #\r
+                    # If not itself, check arch first\r
+                    #\r
+                    for Arch in LibraryClass.SupArchList:\r
+                        #\r
+                        # If arch is supportted, remove all related module type\r
+                        #\r
+                        if Arch in Item.SupArchList:\r
+                            for ModuleType in Item.ModuleType:\r
+                                EdkLogger.debug(EdkLogger.DEBUG_3, "\tLibraryClass %s has specific defined module types" % Name)\r
+                                if ModuleType in SupModuleList:\r
+                                    SupModuleList.remove(ModuleType)\r
 \r
         return SupModuleList\r
     \r