]> git.proxmox.com Git - mirror_edk2.git/commitdiff
BaseTools: Fix the GenMake bug for .cpp source file
authorFeng, Bob C <bob.c.feng@intel.com>
Sat, 25 Jun 2022 05:11:40 +0000 (13:11 +0800)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Tue, 28 Jun 2022 09:14:55 +0000 (09:14 +0000)
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>
Reviewed-by: Yuwei Chen<yuwei.chen@intel.com>
BaseTools/Source/Python/AutoGen/GenMake.py

index da406e6ff468e41794a2d5a25d12b06056a2e6fe..92c7bf0cdad52e07795d42b84c77e79f7c0bd81b 100755 (executable)
@@ -1110,7 +1110,8 @@ cleanlib:
                         CmdTargetDict[CmdSign].append(SingleCommandList[-1])\r
                     Index = CommandList.index(Item)\r
                     CommandList.pop(Index)\r
-                    if SingleCommandList[-1].endswith("%s%s.c" % (TAB_SLASH, CmdSumDict[CmdSign[3:].rsplit(TAB_SLASH, 1)[0]])):\r
+                    BaseName = SingleCommandList[-1].rsplit('.',1)[0]\r
+                    if BaseName.endswith("%s%s" % (TAB_SLASH, CmdSumDict[CmdSign[3:].rsplit(TAB_SLASH, 1)[0]])):\r
                         Cpplist = CmdCppDict[T.Target.SubDir]\r
                         Cpplist.insert(0, '$(OBJLIST_%d): ' % list(self.ObjTargetDict.keys()).index(T.Target.SubDir))\r
                         source_files = CmdTargetDict[CmdSign][1:]\r