public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [Patch] BaseTools: Fix the GenMake bug for .cpp source file
@ 2022-06-25  5:11 Bob Feng
  2022-06-27  1:23 ` Yuwei Chen
  0 siblings, 1 reply; 2+ messages in thread
From: Bob Feng @ 2022-06-25  5:11 UTC (permalink / raw)
  To: devel; +Cc: Feng, Bob C, Liming Gao, Yuwei Chen

From: "Feng, Bob C" <bob.c.feng@intel.com>

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 <bob.c.feng@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Yuwei Chen <yuwei.chen@intel.com>
---
 BaseTools/Source/Python/AutoGen/GenMake.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

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
@@ -1108,11 +1108,12 @@ cleanlib:
                     else:
                         # CmdTargetDict[CmdSign] = "%s %s" % (CmdTargetDict[CmdSign], SingleCommandList[-1])
                         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:]
                         source_files.insert(0, " ")
                         if len(source_files)>2:
-- 
2.29.1.windows.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Patch] BaseTools: Fix the GenMake bug for .cpp source file
  2022-06-25  5:11 [Patch] BaseTools: Fix the GenMake bug for .cpp source file Bob Feng
@ 2022-06-27  1:23 ` Yuwei Chen
  0 siblings, 0 replies; 2+ messages in thread
From: Yuwei Chen @ 2022-06-27  1:23 UTC (permalink / raw)
  To: Feng, Bob C, devel@edk2.groups.io; +Cc: Gao, Liming

Reviewed-by: Yuwei Chen<yuwei.chen@intel.com>

> -----Original Message-----
> From: Feng, Bob C <bob.c.feng@intel.com>
> Sent: Saturday, June 25, 2022 1:12 PM
> To: devel@edk2.groups.io
> Cc: Feng, Bob C <bob.c.feng@intel.com>; Gao, Liming
> <gaoliming@byosoft.com.cn>; Chen, Christine <yuwei.chen@intel.com>
> Subject: [Patch] BaseTools: Fix the GenMake bug for .cpp source file
> 
> From: "Feng, Bob C" <bob.c.feng@intel.com>
> 
> 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 <bob.c.feng@intel.com>
> Cc: Liming Gao <gaoliming@byosoft.com.cn>
> Cc: Yuwei Chen <yuwei.chen@intel.com>
> ---
>  BaseTools/Source/Python/AutoGen/GenMake.py | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> 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
> @@ -1108,11 +1108,12 @@ cleanlib:
>                      else:                         # CmdTargetDict[CmdSign] = "%s %s" %
> (CmdTargetDict[CmdSign], SingleCommandList[-1])
> 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:]                         source_files.insert(0,
> " ")                         if len(source_files)>2:--
> 2.29.1.windows.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-06-27  1:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-06-25  5:11 [Patch] BaseTools: Fix the GenMake bug for .cpp source file Bob Feng
2022-06-27  1:23 ` Yuwei Chen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox