Added code to check if 'COMMON' in result of parsed sections.
authorjwang36 <jwang36@7335b38e-4728-0410-8992-fb3ffe349368>
Tue, 29 Jan 2008 09:03:07 +0000 (09:03 +0000)
committerjwang36 <jwang36@7335b38e-4728-0410-8992-fb3ffe349368>
Tue, 29 Jan 2008 09:03:07 +0000 (09:03 +0000)
git-svn-id: https://buildtools.tianocore.org/svn/buildtools/trunk/BaseTools@988 7335b38e-4728-0410-8992-fb3ffe349368

Source/Python/Common/InfClassObject.py

index bb0055d..a74a3df 100755 (executable)
@@ -229,18 +229,20 @@ class Inf(InfObject):
     # Find the contents defined in all arches and merge them to all\r
     #\r
     def MergeAllArches(self):\r
-        for Arch in DataType.ARCH_LIST:\r
-            if Arch not in self.Defines:\r
-                self.Defines[Arch] = InfDefines()\r
-            self.Defines[Arch].extend(self.Defines[DataType.TAB_ARCH_COMMON.upper()])\r
-            self._Macro.update(self.Defines[Arch].DefinesDictionary[TAB_INF_DEFINES_MACRO])\r
+        if DataType.TAB_ARCH_COMMON.upper(self.Defines) in self.Defines:\r
+            for Arch in DataType.ARCH_LIST:\r
+                if Arch not in self.Defines:\r
+                    self.Defines[Arch] = InfDefines()\r
+                self.Defines[Arch].extend(self.Defines[DataType.TAB_ARCH_COMMON.upper()])\r
+                self._Macro.update(self.Defines[Arch].DefinesDictionary[TAB_INF_DEFINES_MACRO])\r
         self._Macro.update(GlobalData.gGlobalDefines)\r
         # print "###",self._Macro\r
 \r
-        for Key in self.KeyList:\r
-            for Arch in DataType.ARCH_LIST:\r
-                Command = "self.Contents[Arch]." + Key + ".extend(" + "self.Contents['" + DataType.TAB_ARCH_COMMON + "']." + Key + ")"\r
-                eval(Command)     \r
+        if DataType.TAB_ARCH_COMMON in self.Contents:\r
+            for Key in self.KeyList:\r
+                for Arch in DataType.ARCH_LIST:\r
+                    Command = "self.Contents[Arch]." + Key + ".extend(" + "self.Contents['" + DataType.TAB_ARCH_COMMON + "']." + Key + ")"\r
+                    eval(Command)     \r
 \r
     ## Parse Inf file\r
     #\r