package/gtest: drop patch adding debug 'd' to library names in pkg-config files
- drop patch adding debug 'd' to gmock/gtest library names in pkg-config files
(not longer needed since gtest version bump to 1.22 ([1]) and upstream
commit 'FIX #2174 -- remove `DEBUG_POSTFIX`' ([2]).
Fixes:
http://autobuild.buildroot.net/results/5ea8f180e4909f8157565238b25f567fcf1f3beb
.../host/opt/ext-toolchain/bin/../lib/gcc/aarch64-linux-gnu/7.3.1/../../../../aarch64-linux-gnu/bin/ld: cannot find -lgtestd
[1] https://git.buildroot.net/buildroot/commit/?id=a336b731af5979a25213b33c5840de6d1ed88bdc
[2] ca3ffd90f2
Signed-off-by: Peter Seiderer <ps.report@gmx.net>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
This commit is contained in:
parent
0f868e97f6
commit
f661c00342
@ -1,62 +0,0 @@
|
||||
From cf5a3177159ca832470e7f876cab0a1923fa666f Mon Sep 17 00:00:00 2001
|
||||
From: Peter Seiderer <ps.report@gmx.net>
|
||||
Date: Fri, 22 Oct 2021 20:17:36 +0200
|
||||
Subject: [PATCH] pkg-config: fix gtest.pc/gmock.pc library names for the debug
|
||||
build
|
||||
|
||||
In case CMAKE_BUILD_TYPE is set to Debug the gtest library is
|
||||
name libgtestd.a but the link command returned from gtest.pc is
|
||||
'-lgtest' (without the debug d) and so the linking of dependent
|
||||
packages fails (see [1] for a buildroot failure example).
|
||||
|
||||
Enhance the gtest.pc ang gmock.pc generation to honour the debug 'd'.
|
||||
|
||||
[1] http://lists.busybox.net/pipermail/buildroot/2021-October/626382.html
|
||||
|
||||
[Upstream: https://github.com/google/googletest/pull/3625]
|
||||
Signed-off-by: Peter Seiderer <ps.report@gmx.net>
|
||||
---
|
||||
googlemock/cmake/gmock.pc.in | 2 +-
|
||||
googletest/cmake/gtest.pc.in | 2 +-
|
||||
googletest/cmake/internal_utils.cmake | 3 +++
|
||||
3 files changed, 5 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/googlemock/cmake/gmock.pc.in b/googlemock/cmake/gmock.pc.in
|
||||
index 23c67b5c..0f469857 100644
|
||||
--- a/googlemock/cmake/gmock.pc.in
|
||||
+++ b/googlemock/cmake/gmock.pc.in
|
||||
@@ -6,5 +6,5 @@ Description: GoogleMock (without main() function)
|
||||
Version: @PROJECT_VERSION@
|
||||
URL: https://github.com/google/googletest
|
||||
Requires: gtest = @PROJECT_VERSION@
|
||||
-Libs: -L${libdir} -lgmock @CMAKE_THREAD_LIBS_INIT@
|
||||
+Libs: -L${libdir} -lgmock@DEBUG_POSTFIX@ @CMAKE_THREAD_LIBS_INIT@
|
||||
Cflags: -I${includedir} @GTEST_HAS_PTHREAD_MACRO@
|
||||
diff --git a/googletest/cmake/gtest.pc.in b/googletest/cmake/gtest.pc.in
|
||||
index b4148fae..225bba81 100644
|
||||
--- a/googletest/cmake/gtest.pc.in
|
||||
+++ b/googletest/cmake/gtest.pc.in
|
||||
@@ -5,5 +5,5 @@ Name: gtest
|
||||
Description: GoogleTest (without main() function)
|
||||
Version: @PROJECT_VERSION@
|
||||
URL: https://github.com/google/googletest
|
||||
-Libs: -L${libdir} -lgtest @CMAKE_THREAD_LIBS_INIT@
|
||||
+Libs: -L${libdir} -lgtest@DEBUG_POSTFIX@ @CMAKE_THREAD_LIBS_INIT@
|
||||
Cflags: -I${includedir} @GTEST_HAS_PTHREAD_MACRO@
|
||||
diff --git a/googletest/cmake/internal_utils.cmake b/googletest/cmake/internal_utils.cmake
|
||||
index 58fc9bfb..fd81b825 100644
|
||||
--- a/googletest/cmake/internal_utils.cmake
|
||||
+++ b/googletest/cmake/internal_utils.cmake
|
||||
@@ -335,6 +335,9 @@ function(install_project)
|
||||
# Configure and install pkgconfig files.
|
||||
foreach(t ${ARGN})
|
||||
set(configured_pc "${generated_dir}/${t}.pc")
|
||||
+ if(CMAKE_BUILD_TYPE MATCHES Debug)
|
||||
+ set(DEBUG_POSTFIX "d")
|
||||
+ endif()
|
||||
configure_file("${PROJECT_SOURCE_DIR}/cmake/${t}.pc.in"
|
||||
"${configured_pc}" @ONLY)
|
||||
install(FILES "${configured_pc}"
|
||||
--
|
||||
2.33.1
|
||||
|
Loading…
Reference in New Issue
Block a user