From ab957f036f6711869283217227480b109aedc8ef Mon Sep 17 00:00:00 2001 From: Michael D Kinney Date: Tue, 20 Apr 2021 23:12:51 -0700 Subject: BaseTools/Source/Python: New Target/ToolChain/Arch in DSC [BuildOptions] REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3359 Update BaseTools to support new build targets, new tool chains, and new architectures declared in DSC file [BuildOptions] sections. * Do not expand * when tools_def.txt is parsed. Only expand when both tools_def.txt and DSC [BuilsOptions] sections have been parsed. This also requires more flexible matching of tool keys that contain * in tool key fields. * Pre-scan the platform DSC file for FAMILY and TOOLCHAIN declarations DSC in [BuildOptions] sections before the FAMILY and TOOLCHAIN need to be known. Cc: Bob Feng Cc: Liming Gao Cc: Yuwei Chen Signed-off-by: Michael D Kinney Reviewed-by: Bob Feng --- .../Source/Python/GenFds/GenFdsGlobalVariable.py | 31 +++++++++++++++------- 1 file changed, 22 insertions(+), 9 deletions(-) (limited to 'BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py') diff --git a/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py b/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py index 3019ec63c3..c31fc24870 100644 --- a/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py +++ b/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py @@ -1,7 +1,7 @@ ## @file # Global variables for GenFds # -# Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.
+# Copyright (c) 2007 - 2021, Intel Corporation. All rights reserved.
# # SPDX-License-Identifier: BSD-2-Clause-Patent # @@ -875,14 +875,27 @@ def FindExtendTool(KeyStringList, CurrentArchList, NameGuid): ToolOptionKey = None KeyList = None for tool_def in ToolDefinition.items(): - if NameGuid.lower() == tool_def[1].lower(): - KeyList = tool_def[0].split('_') - Key = KeyList[0] + \ - '_' + \ - KeyList[1] + \ - '_' + \ - KeyList[2] - if Key in KeyStringList and KeyList[4] == DataType.TAB_GUID: + KeyList = tool_def[0].split('_') + if len(KeyList) < 5: + continue + if KeyList[4] != DataType.TAB_GUID: + continue + if NameGuid.lower() != tool_def[1].lower(): + continue + Key = KeyList[0] + \ + '_' + \ + KeyList[1] + \ + '_' + \ + KeyList[2] + for KeyString in KeyStringList: + KeyStringBuildTarget, KeyStringToolChain, KeyStringArch = KeyString.split('_') + if KeyList[0] == DataType.TAB_STAR: + KeyList[0] = KeyStringBuildTarget + if KeyList[1] == DataType.TAB_STAR: + KeyList[1] = KeyStringToolChain + if KeyList[2] == DataType.TAB_STAR: + KeyList[2] = KeyStringArch + if KeyList[0] == KeyStringBuildTarget and KeyList[1] == KeyStringToolChain and KeyList[2] == KeyStringArch: ToolPathKey = Key + '_' + KeyList[3] + '_PATH' ToolOptionKey = Key + '_' + KeyList[3] + '_FLAGS' ToolPath = ToolDefinition.get(ToolPathKey) -- cgit v1.2.3