diff options
author | Yingke Liu <yingke.d.liu@intel.com> | 2015-06-19 01:43:45 +0000 |
---|---|---|
committer | yingke <yingke@Edk2> | 2015-06-19 01:43:45 +0000 |
commit | 1ba5124ed0ff033cf6c95f62c84987ee3e9d29f4 (patch) | |
tree | 4e2f9beb09424e3de3303025f38f9e29594474b7 /BaseTools/Source/Python/AutoGen/AutoGen.py | |
parent | 27f19717275af51d13df543c6627e1d743eb11cf (diff) | |
download | edk2-platforms-1ba5124ed0ff033cf6c95f62c84987ee3e9d29f4.tar.xz |
BaseTools: Fixed Build Option override bugs.
if '==' is specified, it overrides all options that specified by '='; if no '==' is specified, all options that match current build criteria are combined.
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@17665 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'BaseTools/Source/Python/AutoGen/AutoGen.py')
-rw-r--r-- | BaseTools/Source/Python/AutoGen/AutoGen.py | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py b/BaseTools/Source/Python/AutoGen/AutoGen.py index 0e7482a87a..ca7d5abb62 100644 --- a/BaseTools/Source/Python/AutoGen/AutoGen.py +++ b/BaseTools/Source/Python/AutoGen/AutoGen.py @@ -1963,7 +1963,8 @@ class PlatformAutoGen(AutoGen): # Key[0] -- tool family
# Key[1] -- TARGET_TOOLCHAIN_ARCH_COMMANDTYPE_ATTRIBUTE
#
- if Key[0] == self.BuildRuleFamily :
+ if (Key[0] == self.BuildRuleFamily and
+ (ModuleStyle == None or len(Key) < 3 or (len(Key) > 2 and Key[2] == ModuleStyle))):
Target, ToolChain, Arch, CommandType, Attr = Key[1].split('_')
if Target == self.BuildTarget or Target == "*":
if ToolChain == self.ToolChain or ToolChain == "*":
@@ -1999,7 +2000,7 @@ class PlatformAutoGen(AutoGen): if Options.get((self.BuildRuleFamily, NowKey)) != None:
Options.pop((self.BuildRuleFamily, NowKey))
-
+ OverrideOpt = set()
for Key in Options:
if ModuleStyle != None and len (Key) > 2:
# Check Module style is EDK or EDKII.
@@ -2025,7 +2026,9 @@ class PlatformAutoGen(AutoGen): if Arch == "*" or Arch == self.Arch:
if Tool not in BuildOptions:
BuildOptions[Tool] = {}
- if Attr != "FLAGS" or Attr not in BuildOptions[Tool]:
+ if Options[Key].startswith('='):
+ OverrideOpt.add((Tool, Attr))
+ if Attr != "FLAGS" or Attr not in BuildOptions[Tool] or (Tool, Attr) in OverrideOpt:
BuildOptions[Tool][Attr] = Options[Key]
else:
# append options for the same tool
@@ -2033,7 +2036,8 @@ class PlatformAutoGen(AutoGen): # Build Option Family has been checked, which need't to be checked again for family.
if FamilyMatch or FamilyIsNull:
return BuildOptions
-
+
+ OverrideOpt = set()
for Key in Options:
if ModuleStyle != None and len (Key) > 2:
# Check Module style is EDK or EDKII.
@@ -2057,7 +2061,9 @@ class PlatformAutoGen(AutoGen): if Arch == "*" or Arch == self.Arch:
if Tool not in BuildOptions:
BuildOptions[Tool] = {}
- if Attr != "FLAGS" or Attr not in BuildOptions[Tool]:
+ if Options[Key].startswith('='):
+ OverrideOpt.add((Tool, Attr))
+ if Attr != "FLAGS" or Attr not in BuildOptions[Tool] or (Tool, Attr) in OverrideOpt:
BuildOptions[Tool][Attr] = Options[Key]
else:
# append options for the same tool
@@ -2097,6 +2103,7 @@ class PlatformAutoGen(AutoGen): PlatformModuleOptions.keys() + ModuleTypeOptions.keys() +
self.ToolDefinition.keys())
BuildOptions = {}
+ OverrideTool = set()
for Tool in AllTools:
if Tool not in BuildOptions:
BuildOptions[Tool] = {}
@@ -2115,8 +2122,9 @@ class PlatformAutoGen(AutoGen): BuildOptions[Tool][Attr] = ""
# check if override is indicated
if Value.startswith('='):
+ OverrideTool.add((Tool, Attr))
BuildOptions[Tool][Attr] = Value[1:]
- else:
+ elif (Tool, Attr) not in OverrideTool:
BuildOptions[Tool][Attr] += " " + Value
if Module.AutoGenVersion < 0x00010005 and self.Workspace.UniFlag != None:
#
|