From 59141288716f8917968d4bb96367b7d08fe5ab8a Mon Sep 17 00:00:00 2001 From: "Feng, Bob C" Date: Sat, 25 Jun 2022 13:11:40 +0800 Subject: BaseTools: Fix the GenMake bug for .cpp source file Build-rules.txt lists .cc and .cpp as supported file extensions. BaseTools commit 05217d210e introduce a regression issue that ignore the .cc and .cpp file type. This patch is to fix this bug. Signed-off-by: Bob Feng Cc: Liming Gao Cc: Yuwei Chen Reviewed-by: Yuwei Chen --- BaseTools/Source/Python/AutoGen/GenMake.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'BaseTools') diff --git a/BaseTools/Source/Python/AutoGen/GenMake.py b/BaseTools/Source/Python/AutoGen/GenMake.py index da406e6ff4..92c7bf0cda 100755 --- a/BaseTools/Source/Python/AutoGen/GenMake.py +++ b/BaseTools/Source/Python/AutoGen/GenMake.py @@ -1110,7 +1110,8 @@ cleanlib: CmdTargetDict[CmdSign].append(SingleCommandList[-1]) Index = CommandList.index(Item) CommandList.pop(Index) - if SingleCommandList[-1].endswith("%s%s.c" % (TAB_SLASH, CmdSumDict[CmdSign[3:].rsplit(TAB_SLASH, 1)[0]])): + BaseName = SingleCommandList[-1].rsplit('.',1)[0] + if BaseName.endswith("%s%s" % (TAB_SLASH, CmdSumDict[CmdSign[3:].rsplit(TAB_SLASH, 1)[0]])): Cpplist = CmdCppDict[T.Target.SubDir] Cpplist.insert(0, '$(OBJLIST_%d): ' % list(self.ObjTargetDict.keys()).index(T.Target.SubDir)) source_files = CmdTargetDict[CmdSign][1:] -- cgit