]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/AutoGen/BuildEngine.py
BaseTools: Fix a bug for Size incorrect of Void* Fixatbuild Pcd
[mirror_edk2.git] / BaseTools / Source / Python / AutoGen / BuildEngine.py
index 0daed7da610db1340c273205b671cb55a1166b95..1663ddd21bb03ec03563053b836ec0873de98d3b 100644 (file)
@@ -161,7 +161,7 @@ class FileBuildRule:
 \r
         # Check input files\r
         self.IsMultipleInput = False\r
-        self.SourceFileExtList = []\r
+        self.SourceFileExtList = set()\r
         for File in Input:\r
             Base, Ext = os.path.splitext(File)\r
             if Base.find("*") >= 0:\r
@@ -172,8 +172,7 @@ class FileBuildRule:
                 # There's no "*" and "?" in file name\r
                 self.ExtraSourceFileList.append(File)\r
                 continue\r
-            if Ext not in self.SourceFileExtList:\r
-                self.SourceFileExtList.append(Ext)\r
+            self.SourceFileExtList.add(Ext)\r
 \r
         # Check output files\r
         self.DestFileList = []\r
@@ -194,16 +193,6 @@ class FileBuildRule:
         CommandString = "\n\t".join(self.CommandList)\r
         return "%s : %s\n\t%s" % (DestString, SourceString, CommandString)\r
 \r
-    ## Check if given file extension is supported by this rule\r
-    #\r
-    #   @param  FileExt     The extension of a file\r
-    #\r
-    #   @retval True        If the extension is supported\r
-    #   @retval False       If the extension is not supported\r
-    #\r
-    def IsSupported(self, FileExt):\r
-        return FileExt in self.SourceFileExtList\r
-\r
     def Instantiate(self, Macros={}):\r
         NewRuleObject = copy.copy(self)\r
         NewRuleObject.BuildTargets = {}\r
@@ -365,8 +354,8 @@ class BuildRule:
         self._State = ""\r
         self._RuleInfo = tdict(True, 2)     # {toolchain family : {"InputFile": {}, "OutputFile" : [], "Command" : []}}\r
         self._FileType = ''\r
-        self._BuildTypeList = []\r
-        self._ArchList = []\r
+        self._BuildTypeList = set()\r
+        self._ArchList = set()\r
         self._FamilyList = []\r
         self._TotalToolChainFamilySet = set()\r
         self._RuleObjectList = [] # FileBuildRule object list\r
@@ -456,8 +445,8 @@ class BuildRule:
     #\r
     def ParseSectionHeader(self, LineIndex):\r
         self._RuleInfo = tdict(True, 2)\r
-        self._BuildTypeList = []\r
-        self._ArchList = []\r
+        self._BuildTypeList = set()\r
+        self._ArchList = set()\r
         self._FamilyList = []\r
         self._TotalToolChainFamilySet = set()\r
         FileType = ''\r
@@ -494,10 +483,8 @@ class BuildRule:
                     BuildType = TokenList[1]\r
                 if len(TokenList) > 2:\r
                     Arch = TokenList[2]\r
-            if BuildType not in self._BuildTypeList:\r
-                self._BuildTypeList.append(BuildType)\r
-            if Arch not in self._ArchList:\r
-                self._ArchList.append(Arch)\r
+            self._BuildTypeList.add(BuildType)\r
+            self._ArchList.add(Arch)\r
 \r
         if 'COMMON' in self._BuildTypeList and len(self._BuildTypeList) > 1:\r
             EdkLogger.error("build", FORMAT_INVALID,\r