summaryrefslogtreecommitdiff
path: root/BaseTools/Source/Python/Workspace
diff options
context:
space:
mode:
authorYingke Liu <yingke.d.liu@intel.com>2015-07-02 03:42:34 +0000
committeryingke <yingke@Edk2>2015-07-02 03:42:34 +0000
commit5015bee226c293c32c9ef2cc7669826edb5a0aed (patch)
tree83ed49ec35053cd5b04e37c82733788f5417dc40 /BaseTools/Source/Python/Workspace
parentc587fd3eddce6532b3b71bf80a9cf0d70b7f45e7 (diff)
downloadedk2-platforms-5015bee226c293c32c9ef2cc7669826edb5a0aed.tar.xz
BaseTools: Fixed BuildOptions bug.
The BuildOptions in an INF should also follow override rule: If '==' is used, all previous options are overridden. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yingke Liu <yingke.d.liu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17796 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'BaseTools/Source/Python/Workspace')
-rw-r--r--BaseTools/Source/Python/Workspace/WorkspaceDatabase.py14
1 files changed, 4 insertions, 10 deletions
diff --git a/BaseTools/Source/Python/Workspace/WorkspaceDatabase.py b/BaseTools/Source/Python/Workspace/WorkspaceDatabase.py
index 9da6ac7a41..fd10c5dfb9 100644
--- a/BaseTools/Source/Python/Workspace/WorkspaceDatabase.py
+++ b/BaseTools/Source/Python/Workspace/WorkspaceDatabase.py
@@ -753,7 +753,6 @@ class DscBuildData(PlatformBuildClassObject):
## Retrieve [BuildOptions]
def _GetBuildOptions(self):
if self._BuildOptions == None:
- OverrideTool = set()
self._BuildOptions = sdict()
#
# Retrieve build option for EDKII and EDK style module
@@ -762,12 +761,10 @@ class DscBuildData(PlatformBuildClassObject):
RecordList = self._RawData[MODEL_META_DATA_BUILD_OPTION, self._Arch, CodeBase]
for ToolChainFamily, ToolChain, Option, Dummy1, Dummy2, Dummy3, Dummy4 in RecordList:
CurKey = (ToolChainFamily, ToolChain, CodeBase)
- if Option.startswith('='):
- OverrideTool.add(CurKey)
#
# Only flags can be appended
#
- if CurKey not in self._BuildOptions or not ToolChain.endswith('_FLAGS') or CurKey in OverrideTool:
+ if CurKey not in self._BuildOptions or not ToolChain.endswith('_FLAGS') or Option.startswith('='):
self._BuildOptions[CurKey] = Option
else:
self._BuildOptions[CurKey] += ' ' + Option
@@ -778,16 +775,13 @@ class DscBuildData(PlatformBuildClassObject):
self._ModuleTypeOptions = sdict()
if (Edk, ModuleType) not in self._ModuleTypeOptions:
options = sdict()
- OverrideTool = set()
self._ModuleTypeOptions[Edk, ModuleType] = options
DriverType = '%s.%s' % (Edk, ModuleType)
RecordList = self._RawData[MODEL_META_DATA_BUILD_OPTION, self._Arch, DriverType]
for ToolChainFamily, ToolChain, Option, Arch, Type, Dummy3, Dummy4 in RecordList:
- if Arch == self._Arch and Type == DriverType:
+ if Type == DriverType:
Key = (ToolChainFamily, ToolChain, Edk)
- if Option.startswith('='):
- OverrideTool.add(Key)
- if Key not in options or not ToolChain.endswith('_FLAGS') or Key in OverrideTool:
+ if Key not in options or not ToolChain.endswith('_FLAGS') or Option.startswith('='):
options[Key] = Option
else:
options[Key] += ' ' + Option
@@ -2399,7 +2393,7 @@ class InfBuildData(ModuleBuildClassObject):
ToolChainFamily = Record[0]
ToolChain = Record[1]
Option = Record[2]
- if (ToolChainFamily, ToolChain) not in self._BuildOptions:
+ if (ToolChainFamily, ToolChain) not in self._BuildOptions or Option.startswith('='):
self._BuildOptions[ToolChainFamily, ToolChain] = Option
else:
# concatenate the option string if they're for the same tool