1. Add support for only a library instance name defined in components section of...
authorhche10x <hche10x@7335b38e-4728-0410-8992-fb3ffe349368>
Thu, 13 Sep 2007 05:24:44 +0000 (05:24 +0000)
committerhche10x <hche10x@7335b38e-4728-0410-8992-fb3ffe349368>
Thu, 13 Sep 2007 05:24:44 +0000 (05:24 +0000)
git-svn-id: https://buildtools.tianocore.org/svn/buildtools/trunk/BaseTools@726 7335b38e-4728-0410-8992-fb3ffe349368

Source/Python/Common/DscClassObject.py

index 29cfa20..dcae3fd 100755 (executable)
@@ -11,7 +11,7 @@
 #This file is used to define each component of DSC file\r
 #\r
 \r
-import os\r
+import os, uuid\r
 from String import *\r
 from DataType import *\r
 from Identification import *\r
@@ -359,11 +359,20 @@ class Dsc(DscObject):
         Component.ExecFilePath = ExecFilename\r
         for Lib in LibraryClasses:\r
             List = GetSplitValueList(Lib)\r
-            if len(List) != 2:\r
-                RaiseParserError(Lib, 'LibraryClasses', ContainerFile, '<ClassName>|<InfFilename>')\r
-            CheckFileType(List[1], '.Inf', ContainerFile, 'library instance of component ', Lib)\r
-            CheckFileExist(self.WorkspaceDir, List[1], ContainerFile, 'library instance of component', Lib)\r
-            Component.LibraryClasses.LibraryList.append(PlatformLibraryClass(List[0], List[1]))\r
+            LibName = ''\r
+            LibFile = ''\r
+            if len(List) == 1:\r
+                LibName = uuid.uuid4()\r
+                print LibName\r
+                LibFile = List[0]\r
+            elif len(List) == 2:\r
+                LibName = List[0]\r
+                LibFile = List[1]\r
+            else:\r
+                RaiseParserError(Lib, 'LibraryClasses', ContainerFile, '[<ClassName>|]<InfFilename>')\r
+            CheckFileType(LibFile, '.Inf', ContainerFile, 'library instance of component ', Lib)\r
+            CheckFileExist(self.WorkspaceDir, LibFile, ContainerFile, 'library instance of component', Lib)\r
+            Component.LibraryClasses.LibraryList.append(PlatformLibraryClass(LibName, LibFile))\r
         for BuildOption in BuildOptions:\r
             Key = GetBuildOption(BuildOption, ContainerFile)\r
             Component.ModuleSaBuildOption.BuildOptionList.append(BuildOptionClass(Key[0], Key[1], Key[2]))\r