BaseTools: Fix DSC override of Guided tool

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3359

If the DSC file provides an override of a Guided tool path
and/or Guided tool GUID value, then make sure the one from the
DSC file is used if it is higher priority than the Guided tool
in the tools_def.txt file.  This makes the Guided tool used by
GenFds match the tool listed GuidedSectionTools.txt.

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Yuwei Chen <yuwei.chen@intel.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
This commit is contained in:
Michael D Kinney
2021-05-07 08:40:29 -07:00
committed by mergify[bot]
parent 375f2d8e68
commit ef3840c1ff
3 changed files with 190 additions and 97 deletions

View File

@ -918,14 +918,13 @@ class PlatformAutoGen(AutoGen):
if Tool in self._BuildOptionWithToolDef(RetVal) and Attr in self._BuildOptionWithToolDef(RetVal)[Tool]:
# check if override is indicated
if self._BuildOptionWithToolDef(RetVal)[Tool][Attr].startswith('='):
Value = self._BuildOptionWithToolDef(RetVal)[Tool][Attr][1:]
Value = self._BuildOptionWithToolDef(RetVal)[Tool][Attr][1:].strip()
else:
if Attr != 'PATH':
# Do not append PATH or GUID
if Attr != 'PATH' and Attr != 'GUID':
Value += " " + self._BuildOptionWithToolDef(RetVal)[Tool][Attr]
else:
Value = self._BuildOptionWithToolDef(RetVal)[Tool][Attr]
Def = '_'.join([self.BuildTarget, self.ToolChain, self.Arch, Tool, Attr])
self.Workspace.ToolDef.ToolsDefTxtDictionary[Def] = Value
if Attr == "PATH":
# Don't put MAKE definition in the file
if Tool != "MAKE":