BaseTools: Fix bug for GUIDED tool path override by DSC [BuildOptions]

Current the GUIDED tool path can't be override to the different path in
the [BuildOptions] of DSC file. This patch fix the bug.

Fixes: https://bugzilla.tianocore.org/show_bug.cgi?id=283
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
This commit is contained in:
Yonghong Zhu
2017-02-15 14:47:47 +08:00
parent b173ad7851
commit 958163561e
2 changed files with 68 additions and 22 deletions

View File

@ -1718,7 +1718,10 @@ class PlatformAutoGen(AutoGen):
if self.BuildOption[Tool][Attr].startswith('='):
Value = self.BuildOption[Tool][Attr][1:]
else:
Value += " " + self.BuildOption[Tool][Attr]
if Attr != 'PATH':
Value += " " + self.BuildOption[Tool][Attr]
else:
Value = self.BuildOption[Tool][Attr]
if Attr == "PATH":
# Don't put MAKE definition in the file
@ -2381,8 +2384,11 @@ class PlatformAutoGen(AutoGen):
if Attr != "FLAGS" or Attr not in BuildOptions[Tool] or Options[Key].startswith('='):
BuildOptions[Tool][Attr] = Options[Key]
else:
# append options for the same tool
BuildOptions[Tool][Attr] += " " + Options[Key]
# append options for the same tool except PATH
if Attr != 'PATH':
BuildOptions[Tool][Attr] += " " + Options[Key]
else:
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
@ -2413,8 +2419,11 @@ class PlatformAutoGen(AutoGen):
if Attr != "FLAGS" or Attr not in BuildOptions[Tool] or Options[Key].startswith('='):
BuildOptions[Tool][Attr] = Options[Key]
else:
# append options for the same tool
BuildOptions[Tool][Attr] += " " + Options[Key]
# append options for the same tool except PATH
if Attr != 'PATH':
BuildOptions[Tool][Attr] += " " + Options[Key]
else:
BuildOptions[Tool][Attr] = Options[Key]
return BuildOptions
## Append build options in platform to a module
@ -2473,7 +2482,10 @@ class PlatformAutoGen(AutoGen):
BuildOptions[Tool][Attr] = ToolPath
else:
Value = mws.handleWsMacro(Value)
BuildOptions[Tool][Attr] += " " + Value
if Attr != 'PATH':
BuildOptions[Tool][Attr] += " " + Value
else:
BuildOptions[Tool][Attr] = Value
if Module.AutoGenVersion < 0x00010005 and self.Workspace.UniFlag != None:
#
# Override UNI flag only for EDK module.