]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/Workspace/WorkspaceDatabase.py
BaseTools: Fixed BuildOptions bug.
[mirror_edk2.git] / BaseTools / Source / Python / Workspace / WorkspaceDatabase.py
index 9da6ac7a4164023a5b782ed03341a1fb54790978..fd10c5dfb9a8f4d493da00cd353a788d78841f0a 100644 (file)
@@ -753,7 +753,6 @@ class DscBuildData(PlatformBuildClassObject):
     ## Retrieve [BuildOptions]\r
     def _GetBuildOptions(self):\r
         if self._BuildOptions == None:\r
-            OverrideTool = set()\r
             self._BuildOptions = sdict()\r
             #\r
             # Retrieve build option for EDKII and EDK style module\r
@@ -762,12 +761,10 @@ class DscBuildData(PlatformBuildClassObject):
                 RecordList = self._RawData[MODEL_META_DATA_BUILD_OPTION, self._Arch, CodeBase]\r
                 for ToolChainFamily, ToolChain, Option, Dummy1, Dummy2, Dummy3, Dummy4 in RecordList:\r
                     CurKey = (ToolChainFamily, ToolChain, CodeBase)\r
-                    if Option.startswith('='):\r
-                        OverrideTool.add(CurKey)\r
                     #\r
                     # Only flags can be appended\r
                     #\r
-                    if CurKey not in self._BuildOptions or not ToolChain.endswith('_FLAGS') or CurKey in OverrideTool:\r
+                    if CurKey not in self._BuildOptions or not ToolChain.endswith('_FLAGS') or Option.startswith('='):\r
                         self._BuildOptions[CurKey] = Option\r
                     else:\r
                         self._BuildOptions[CurKey] += ' ' + Option\r
@@ -778,16 +775,13 @@ class DscBuildData(PlatformBuildClassObject):
             self._ModuleTypeOptions = sdict()\r
         if (Edk, ModuleType) not in self._ModuleTypeOptions:\r
             options = sdict()\r
-            OverrideTool = set()\r
             self._ModuleTypeOptions[Edk, ModuleType] = options\r
             DriverType = '%s.%s' % (Edk, ModuleType)\r
             RecordList = self._RawData[MODEL_META_DATA_BUILD_OPTION, self._Arch, DriverType]\r
             for ToolChainFamily, ToolChain, Option, Arch, Type, Dummy3, Dummy4 in RecordList:\r
-                if Arch == self._Arch and Type == DriverType:\r
+                if Type == DriverType:\r
                     Key = (ToolChainFamily, ToolChain, Edk)\r
-                    if Option.startswith('='):\r
-                        OverrideTool.add(Key)\r
-                    if Key not in options or not ToolChain.endswith('_FLAGS') or Key in OverrideTool:\r
+                    if Key not in options or not ToolChain.endswith('_FLAGS') or Option.startswith('='):\r
                         options[Key] = Option\r
                     else:\r
                         options[Key] += ' ' + Option\r
@@ -2399,7 +2393,7 @@ class InfBuildData(ModuleBuildClassObject):
                 ToolChainFamily = Record[0]\r
                 ToolChain = Record[1]\r
                 Option = Record[2]\r
-                if (ToolChainFamily, ToolChain) not in self._BuildOptions:\r
+                if (ToolChainFamily, ToolChain) not in self._BuildOptions or Option.startswith('='):\r
                     self._BuildOptions[ToolChainFamily, ToolChain] = Option\r
                 else:\r
                     # concatenate the option string if they're for the same tool\r