Fixed NULL library instance issue .
authorjwang36 <jwang36@7335b38e-4728-0410-8992-fb3ffe349368>
Tue, 15 Apr 2008 14:19:55 +0000 (14:19 +0000)
committerjwang36 <jwang36@7335b38e-4728-0410-8992-fb3ffe349368>
Tue, 15 Apr 2008 14:19:55 +0000 (14:19 +0000)
git-svn-id: https://buildtools.tianocore.org/svn/buildtools/trunk/BaseTools@1153 7335b38e-4728-0410-8992-fb3ffe349368

Source/Python/Workspace/WorkspaceDatabase.py

index 6a86b52..7fe35a0 100644 (file)
@@ -358,19 +358,21 @@ class DscBuildData(PlatformBuildClassObject):
                 EdkLogger.error('build', FILE_NOT_FOUND, ExtraData=LibraryPath,\r
                                 File=self.DescFilePath, Line=LineNo)\r
             if LibraryClass == '' or LibraryClass == 'NULL':\r
                 EdkLogger.error('build', FILE_NOT_FOUND, ExtraData=LibraryPath,\r
                                 File=self.DescFilePath, Line=LineNo)\r
             if LibraryClass == '' or LibraryClass == 'NULL':\r
-                if LibraryPath not in self._NullLibraryClass:\r
-                    self._NullLibraryNumber += 1\r
-                    LibraryClass = LibraryClassObject('NULL%d' % self._NullLibraryNumber, [ModuleType])\r
+                if LibraryPath not in DscBuildData._NullLibraryClass:\r
+                    DscBuildData._NullLibraryNumber += 1\r
+                    LibraryClass = 'NULL%d' % DscBuildData._NullLibraryNumber\r
+                    Lc = LibraryClassObject(LibraryClass, [ModuleType])\r
                     LibraryInstance = self._Db.BuildObject[LibraryPath, MODEL_FILE_INF, self._Arch]\r
                     LibraryInstance = self._Db.BuildObject[LibraryPath, MODEL_FILE_INF, self._Arch]\r
-                    LibraryInstance.LibraryClass.append(LibraryClass)\r
-                    self._NullLibraryClass[LibraryPath] = LibraryClass\r
+                    LibraryInstance.LibraryClass.append(Lc)\r
+                    DscBuildData._NullLibraryClass[LibraryPath] = Lc\r
                 else:\r
                 else:\r
-                    LibraryClass = self._NullLibraryClass[LibraryPath]\r
+                    Lc = DscBuildData._NullLibraryClass[LibraryPath]\r
+                    LibraryClass = Lc.LibraryClass\r
                     # add new supported module type\r
                     # add new supported module type\r
-                    if ModuleType not in LibraryClass.SupModList:\r
-                        LibraryClass.SupModList.append(ModuleType)\r
+                    if ModuleType not in Lc.SupModList:\r
+                        Lc.SupModList.append(ModuleType)\r
                     LibraryInstance = self._Db.BuildObject[LibraryPath, MODEL_FILE_INF, self._Arch]\r
                     LibraryInstance = self._Db.BuildObject[LibraryPath, MODEL_FILE_INF, self._Arch]\r
-                    LibraryInstance.LibraryClass.append(LibraryClass)\r
+                    LibraryInstance.LibraryClass.append(Lc)\r
 \r
             Module.LibraryClasses[LibraryClass] = LibraryPath\r
 \r
 \r
             Module.LibraryClasses[LibraryClass] = LibraryPath\r
 \r