summaryrefslogtreecommitdiff
path: root/BaseTools/Source/Python/AutoGen/AutoGen.py
diff options
context:
space:
mode:
authorvanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>2009-09-11 03:14:43 +0000
committervanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>2009-09-11 03:14:43 +0000
commitfd171542e0aa89ac12a09d79608173f48019b14b (patch)
treeb4e1320ab3bc1cb59355f9fcbc361f84ae0c4f0a /BaseTools/Source/Python/AutoGen/AutoGen.py
parentf22911b49e8be58d364f9e21f5af6bd3f0513cf7 (diff)
downloadedk2-platforms-fd171542e0aa89ac12a09d79608173f48019b14b.tar.xz
Sync basetools' source and binary files with r1707 of the basetools project.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9257 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'BaseTools/Source/Python/AutoGen/AutoGen.py')
-rw-r--r--BaseTools/Source/Python/AutoGen/AutoGen.py35
1 files changed, 34 insertions, 1 deletions
diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py b/BaseTools/Source/Python/AutoGen/AutoGen.py
index 028c4e34e3..647e1d0052 100644
--- a/BaseTools/Source/Python/AutoGen/AutoGen.py
+++ b/BaseTools/Source/Python/AutoGen/AutoGen.py
@@ -1061,12 +1061,45 @@ class PlatformAutoGen(AutoGen):
#
def _ExpandBuildOption(self, Options):
BuildOptions = {}
+ FamilyMatch = False
+ FamilyIsNull = True
for Key in Options:
Family = Key[0]
Target, Tag, Arch, Tool, Attr = Key[1].split("_")
# if tool chain family doesn't match, skip it
- if Family and Tool in self.ToolDefinition and Family != self.ToolDefinition[Tool]["FAMILY"]:
+ if Tool in self.ToolDefinition and Family != "":
+ FamilyIsNull = False
+ if self.ToolDefinition[Tool].get(TAB_TOD_DEFINES_BUILDRULEFAMILY, "") != "":
+ if Family != self.ToolDefinition[Tool][TAB_TOD_DEFINES_BUILDRULEFAMILY]:
+ continue
+ elif Family != self.ToolDefinition[Tool][TAB_TOD_DEFINES_FAMILY]:
+ continue
+ FamilyMatch = True
+ # expand any wildcard
+ if Target == "*" or Target == self.BuildTarget:
+ if Tag == "*" or Tag == self.ToolChain:
+ if Arch == "*" or Arch == self.Arch:
+ if Tool not in BuildOptions:
+ BuildOptions[Tool] = {}
+ if Attr != "FLAGS" or Attr not in BuildOptions[Tool]:
+ BuildOptions[Tool][Attr] = Options[Key]
+ else:
+ # append options for the same tool
+ BuildOptions[Tool][Attr] += " " + Options[Key]
+ # Build Option Family has been checked, which need't to be checked again for family.
+ if FamilyMatch or FamilyIsNull:
+ return BuildOptions
+
+ for Key in Options:
+ Family = Key[0]
+ Target, Tag, Arch, Tool, Attr = Key[1].split("_")
+ # if tool chain family doesn't match, skip it
+ if Tool not in self.ToolDefinition or Family =="":
continue
+ # option has been added before
+ if Family != self.ToolDefinition[Tool][TAB_TOD_DEFINES_FAMILY]:
+ continue
+
# expand any wildcard
if Target == "*" or Target == self.BuildTarget:
if Tag == "*" or Tag == self.ToolChain: