1. Fix a bug in supporting for only a library instance name defined in components...
authorhche10x <hche10x@7335b38e-4728-0410-8992-fb3ffe349368>
Thu, 13 Sep 2007 07:26:34 +0000 (07:26 +0000)
committerhche10x <hche10x@7335b38e-4728-0410-8992-fb3ffe349368>
Thu, 13 Sep 2007 07:26:34 +0000 (07:26 +0000)
git-svn-id: https://buildtools.tianocore.org/svn/buildtools/trunk/BaseTools@727 7335b38e-4728-0410-8992-fb3ffe349368

Source/Python/Common/DscClassObject.py
Source/Python/Common/EdkIIWorkspaceBuild.py

index dcae3fd..cb5d3b8 100755 (executable)
@@ -362,8 +362,7 @@ class Dsc(DscObject):
             LibName = ''\r
             LibFile = ''\r
             if len(List) == 1:\r
-                LibName = uuid.uuid4()\r
-                print LibName\r
+                LibName = str(uuid.uuid4())\r
                 LibFile = List[0]\r
             elif len(List) == 2:\r
                 LibName = List[0]\r
index 0cc78a3..09b49d7 100755 (executable)
@@ -235,7 +235,7 @@ class WorkspaceBuild(object):
                     #\r
                     for Lib in Item.LibraryClasses.LibraryList:\r
                         self.AddToInfDatabase(Lib.FilePath)\r
-                        self.UpdateLibraryClassOfModule(Module, Lib.Name, Arch)\r
+                        self.UpdateLibraryClassOfModule(Module, Lib.Name, Arch, Lib.FilePath)\r
         \r
         #\r
         # Parse module to get package\r
@@ -710,7 +710,28 @@ class WorkspaceBuild(object):
     # If a module of a platform has its own override libraryclass but the libraryclass not defined in the module\r
     # Add this libraryclass to the module\r
     #\r
-    def UpdateLibraryClassOfModule(self, InfFileName, LibraryClass, Arch):\r
+    def UpdateLibraryClassOfModule(self, InfFileName, LibraryClass, Arch, InstanceFilePath):\r
+        #\r
+        # Update the library instance itself to add this libraryclass name\r
+        #\r
+        LibList = self.InfDatabase[NormPath(InstanceFilePath)].Module.Header.LibraryClass\r
+        NotFound = True\r
+        for Lib in LibList:\r
+            #\r
+            # Find this LibraryClass\r
+            #\r
+            if Lib.LibraryClass == LibraryClass:\r
+                NotFound = False;\r
+                break;\r
+        if NotFound:\r
+            NewLib = LibraryClassClass()\r
+            NewLib.LibraryClass = LibraryClass\r
+            NewLib.SupModuleList = self.InfDatabase[NormPath(InstanceFilePath)].Module.Header.ModuleType.split()\r
+            self.InfDatabase[NormPath(InstanceFilePath)].Module.Header.LibraryClass.append(NewLib)\r
+        \r
+        #\r
+        # Add it to LibraryClasses Section for the module which is using the library\r
+        #\r
         LibList = self.InfDatabase[NormPath(InfFileName)].Module.LibraryClasses\r
         NotFound = True\r
         for Lib in LibList:\r