diff options
author | Bob Feng <bob.c.feng@intel.com> | 2019-07-11 08:57:58 +0800 |
---|---|---|
committer | Liming Gao <liming.gao@intel.com> | 2019-07-12 17:11:58 +0800 |
commit | 2d100d1d73a9f9a38f224e87c48276ba1e84d8ce (patch) | |
tree | da0231989d47603fb285859a526a5047df15d2d5 /BaseTools | |
parent | c630f69df01e832aeae45c37f33d2b93e98c9389 (diff) | |
download | edk2-2d100d1d73a9f9a38f224e87c48276ba1e84d8ce.zip edk2-2d100d1d73a9f9a38f224e87c48276ba1e84d8ce.tar.gz edk2-2d100d1d73a9f9a38f224e87c48276ba1e84d8ce.tar.bz2 |
BaseTools: Fixed the issue when ToolDefinitionFile is not generated
ToolDefinitionFile is generated by PlatformAutoGen.ToolDefinition()
Code assume ToolDefinition is always called before using
ToolDefinitionFile, but in some cases, it's not true.
This patch is to fix this issue.
Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Bob Feng <bob.c.feng@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Diffstat (limited to 'BaseTools')
-rw-r--r-- | BaseTools/Source/Python/AutoGen/AutoGen.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py b/BaseTools/Source/Python/AutoGen/AutoGen.py index c0d0ca1..5cfaf21 100644 --- a/BaseTools/Source/Python/AutoGen/AutoGen.py +++ b/BaseTools/Source/Python/AutoGen/AutoGen.py @@ -1912,8 +1912,8 @@ class PlatformAutoGen(AutoGen): else:
ToolsDef += "%s_%s = %s\n" % (Tool, Attr, Value)
ToolsDef += "\n"
-
- SaveFileOnChange(self.ToolDefinitionFile, ToolsDef, False)
+ tool_def_file = os.path.join(self.MakeFileDir, "TOOLS_DEF." + self.Arch)
+ SaveFileOnChange(tool_def_file, ToolsDef, False)
for DllPath in DllPathList:
os.environ["PATH"] = DllPath + os.pathsep + os.environ["PATH"]
os.environ["MAKE_FLAGS"] = MakeFlags
@@ -1923,7 +1923,10 @@ class PlatformAutoGen(AutoGen): ## Return the paths of tools
@cached_property
def ToolDefinitionFile(self):
- return os.path.join(self.MakeFileDir, "TOOLS_DEF." + self.Arch)
+ tool_def_file = os.path.join(self.MakeFileDir, "TOOLS_DEF." + self.Arch)
+ if not os.path.exists(tool_def_file):
+ self.ToolDefinition
+ return tool_def_file
## Retrieve the toolchain family of given toolchain tag. Default to 'MSFT'.
@cached_property
|