Added code to always check if a toke space GUID is defined in a package.
authorjwang36 <jwang36@7335b38e-4728-0410-8992-fb3ffe349368>
Tue, 4 Dec 2007 06:59:48 +0000 (06:59 +0000)
committerjwang36 <jwang36@7335b38e-4728-0410-8992-fb3ffe349368>
Tue, 4 Dec 2007 06:59:48 +0000 (06:59 +0000)
git-svn-id: https://buildtools.tianocore.org/svn/buildtools/trunk/BaseTools@904 7335b38e-4728-0410-8992-fb3ffe349368

Source/Python/AutoGen/GenC.py

index bf8fba0..3256cb9 100644 (file)
@@ -795,7 +795,7 @@ def GetGuidValue(Packages, CName):
         if CName in P.Ppis:\r
             return P.Ppis[CName]\r
     else:\r
-        PackageListString = "\n\t".join([str(P) for P in Packages])\r
+        PackageListString = "\t" + "\n\t".join([str(P) for P in Packages])\r
         EdkLogger.error("AutoGen", AUTOGEN_ERROR,\r
                         "Cannot find GUID value for %s in all given packages" % CName,\r
                         ExtraData=PackageListString)\r
@@ -808,6 +808,7 @@ def GetGuidValue(Packages, CName):
 #   @param      Pcd         The PCD object\r
 #\r
 def CreateModulePcdCode(Info, AutoGenC, AutoGenH, Pcd):\r
+    TokenSpaceGuidValue = GetGuidValue(Info.PlatformInfo.PackageList, Pcd.TokenSpaceGuidCName)\r
     PcdTokenNumber = Info.PlatformInfo.PcdTokenNumber\r
     #\r
     # Write PCDs\r
@@ -914,6 +915,7 @@ def CreateLibraryPcdCode(Info, AutoGenC, AutoGenH, Pcd):
     PcdTokenNumber = Info.PlatformInfo.PcdTokenNumber\r
     TokenSpaceGuidCName = Pcd.TokenSpaceGuidCName\r
     TokenCName  = Pcd.TokenCName\r
+    TokenSpaceGuidValue = GetGuidValue(Info.PlatformInfo.PackageList, TokenSpaceGuidCName)\r
     if (Pcd.TokenCName, Pcd.TokenSpaceGuidCName) not in PcdTokenNumber:\r
         EdkLogger.error("AutoGen", AUTOGEN_ERROR, "No generated token number for %s|%s\n" % (Pcd.TokenCName, Pcd.TokenSpaceGuidCName))\r
     TokenNumber = PcdTokenNumber[TokenCName, TokenSpaceGuidCName]\r