summaryrefslogtreecommitdiffstats
path: root/BaseTools/Source/Python/GenFds
diff options
context:
space:
mode:
authorPierre Gondois <Pierre.Gondois@arm.com>2021-09-23 16:59:03 +0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2021-09-29 14:31:37 +0000
commitc7d5b046d90805eacd5eb6df669d2e4998cb149c (patch)
treefa3771f89eeb44de7667c4e21c07cb71e7a0761a /BaseTools/Source/Python/GenFds
parent445c39f757f5204c2259d00930972b960483f6a4 (diff)
downloadedk2-c7d5b046d90805eacd5eb6df669d2e4998cb149c.tar.gz
edk2-c7d5b046d90805eacd5eb6df669d2e4998cb149c.tar.bz2
edk2-c7d5b046d90805eacd5eb6df669d2e4998cb149c.zip
BaseTools: Remove hard-coded strings for target and tools_def
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3653 The "target.txt" and "tools_def.txt" filenames are hard-coded at some places when global definitions are available at: BaseTools/Source/Python/Common/TargetTxtClassObject.py: DefaultTargetTxtFile and BaseTools/Source/Python/Common/ToolDefClassObject.py: DefaultToolsDefFile Use these global definitions instead. Also remove the unused gBuildConfiguration and gToolsDefinition variables from build.py Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com> Reviewed-by: Chris Jones <christopher.jones@arm.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
Diffstat (limited to 'BaseTools/Source/Python/GenFds')
-rw-r--r--BaseTools/Source/Python/GenFds/GenFds.py4
-rw-r--r--BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py4
2 files changed, 4 insertions, 4 deletions
diff --git a/BaseTools/Source/Python/GenFds/GenFds.py b/BaseTools/Source/Python/GenFds/GenFds.py
index ae3e776a55..c341045000 100644
--- a/BaseTools/Source/Python/GenFds/GenFds.py
+++ b/BaseTools/Source/Python/GenFds/GenFds.py
@@ -20,7 +20,7 @@ from linecache import getlines
from io import BytesIO
import Common.LongFilePathOs as os
-from Common.TargetTxtClassObject import TargetTxtDict
+from Common.TargetTxtClassObject import TargetTxtDict,gDefaultTargetTxtFile
from Common.DataType import *
import Common.GlobalData as GlobalData
from Common import EdkLogger
@@ -207,7 +207,7 @@ def GenFdsApi(FdsCommandDict, WorkSpaceDataBase=None):
GenFdsGlobalVariable.ConfDir = ConfDirectoryPath
if not GlobalData.gConfDirectory:
GlobalData.gConfDirectory = GenFdsGlobalVariable.ConfDir
- BuildConfigurationFile = os.path.normpath(os.path.join(ConfDirectoryPath, "target.txt"))
+ BuildConfigurationFile = os.path.normpath(os.path.join(ConfDirectoryPath, gDefaultTargetTxtFile))
if os.path.isfile(BuildConfigurationFile) == True:
# if no build target given in command line, get it from target.txt
TargetObj = TargetTxtDict()
diff --git a/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py b/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py
index 25f9d54874..d7668ba681 100644
--- a/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py
+++ b/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py
@@ -24,7 +24,7 @@ from Common import EdkLogger
from Common.Misc import SaveFileOnChange
from Common.TargetTxtClassObject import TargetTxtDict
-from Common.ToolDefClassObject import ToolDefDict
+from Common.ToolDefClassObject import ToolDefDict,gDefaultToolsDefFile
from AutoGen.BuildEngine import ToolBuildRule
import Common.DataType as DataType
from Common.Misc import PathClass,CreateDirectory
@@ -103,7 +103,7 @@ class GenFdsGlobalVariable:
TargetObj = TargetTxtDict()
ToolDefinitionFile = TargetObj.Target.TargetTxtDictionary[DataType.TAB_TAT_DEFINES_TOOL_CHAIN_CONF]
if ToolDefinitionFile == '':
- ToolDefinitionFile = "Conf/tools_def.txt"
+ ToolDefinitionFile = os.path.join('Conf', gDefaultToolsDefFile)
if os.path.isfile(ToolDefinitionFile):
ToolDefObj = ToolDefDict((os.path.join(os.getenv("WORKSPACE"), "Conf")))
ToolDefinition = ToolDefObj.ToolDef.ToolsDefTxtDatabase