Skip to content

Commit

Permalink
Merge pull request #170 from h-vetinari/fix
Browse files Browse the repository at this point in the history
Fix interaction with external gtest
  • Loading branch information
h-vetinari authored Aug 11, 2023
2 parents 38ad1e7 + 9c25f44 commit 07a600d
Show file tree
Hide file tree
Showing 12 changed files with 48 additions and 46 deletions.
5 changes: 0 additions & 5 deletions .azure-pipelines/azure-pipelines-linux.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion .azure-pipelines/azure-pipelines-win.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions .scripts/run_osx_build.sh

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions recipe/build-lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ fi
export CPPFLAGS="${CPPFLAGS} -I${PREFIX}/include"
export LDFLAGS="${LDFLAGS} -L${PREFIX}/lib"

# delete vendored gtest to force protobuf_USE_EXTERNAL_GTEST to work;
# this gets run twice (second time for libprotobuf-static), so don't fail
rm -rf ./third_party/googletest | true

if [[ "$PKG_NAME" == "libprotobuf-static" ]]; then
export CF_SHARED=OFF
mkdir build-static
Expand Down
6 changes: 3 additions & 3 deletions recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ source:
# backport https://github.com/protocolbuffers/protobuf/pull/12577
- patches/0003-Enable-the-selection-of-system-provided-jsoncpp-1257.patch
- patches/0004-always-look-for-shared-abseil-builds.patch
- patches/0005-be-more-lenient-with-abseil-version.patch
# grpc_cpp_java_plugin links against otherwise internal symbols
- patches/0006-Export-functions-in-google-compiler-java-names.patch
- patches/0005-Export-functions-in-google-compiler-java-names.patch
- patches/0006-do-not-install-vendored-gmock.patch

build:
number: 0
number: 1

outputs:
- name: libprotobuf
Expand Down
2 changes: 1 addition & 1 deletion recipe/patches/0001-use-consistent-cmake-location.patch
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From 1a0df0ca9e8d5320556ca15ed1685d578a98500c Mon Sep 17 00:00:00 2001
From c15a3b5551d4ad414ef6840d63153fd5babd71a5 Mon Sep 17 00:00:00 2001
From: "H. Vetinari" <h.vetinari@gmx.com>
Date: Sat, 3 Sep 2022 19:48:04 +0200
Subject: [PATCH 1/6] use consistent cmake location
Expand Down
4 changes: 2 additions & 2 deletions recipe/patches/0002-set-static-lib-extension-on-windows.patch
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From 8e995af87c7cc4ac02f573dc10364765b7b0adfb Mon Sep 17 00:00:00 2001
From 7b2a54aa3e10a6c64dfcbbb0352c4cbd2003abf4 Mon Sep 17 00:00:00 2001
From: "H. Vetinari" <h.vetinari@gmx.com>
Date: Sun, 4 Sep 2022 10:57:08 +0200
Subject: [PATCH 2/6] set static lib extension on windows
Expand All @@ -8,7 +8,7 @@ Subject: [PATCH 2/6] set static lib extension on windows
1 file changed, 6 insertions(+)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index dc09f63db..d0015b799 100644
index 909cfe39a..3104f6500 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -371,6 +371,12 @@ else ()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From e29e3dc895a1dcd60d0a955dbc63f848a0c14e66 Mon Sep 17 00:00:00 2001
From e41c414ae97281f7a10738199be7fa3b4ef359a7 Mon Sep 17 00:00:00 2001
From: Mike Rochefort <mroche@omenos.dev>
Date: Mon, 1 May 2023 09:34:17 -0700
Subject: [PATCH 3/6] Enable the selection of system provided jsoncpp (#12577)
Expand All @@ -17,7 +17,7 @@ PiperOrigin-RevId: 528492610
2 files changed, 22 insertions(+), 12 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index d0015b799..ae0fd1c64 100644
index 3104f6500..b8eccae10 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -332,6 +332,9 @@ endif (protobuf_UNICODE)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From 137cfa12dbc793c2358e8048dde9b35d4e77292d Mon Sep 17 00:00:00 2001
From 52ee899847501a833926b2232dc0e19bad256003 Mon Sep 17 00:00:00 2001
From: "H. Vetinari" <h.vetinari@gmx.com>
Date: Sat, 13 May 2023 22:43:45 +1100
Subject: [PATCH 4/6] always look for shared abseil builds
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From d84ed5304325e4321a3c86c255a87868f72eb371 Mon Sep 17 00:00:00 2001
From 3a047d8d43d088cf07911d87eca1aa7d4c9b69de Mon Sep 17 00:00:00 2001
From: "Uwe L. Korn" <uwe.korn@quantco.com>
Date: Wed, 14 Jun 2023 11:36:55 +0200
Subject: [PATCH 6/6] Export functions in google::compiler::java::names
Subject: [PATCH 5/6] Export functions in google::compiler::java::names

---
src/google/protobuf/compiler/java/names.h | 20 ++++++++++----------
Expand Down
24 changes: 0 additions & 24 deletions recipe/patches/0005-be-more-lenient-with-abseil-version.patch

This file was deleted.

24 changes: 24 additions & 0 deletions recipe/patches/0006-do-not-install-vendored-gmock.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
From b075b8e59c2c9ec51a3937c53545b6e987b44504 Mon Sep 17 00:00:00 2001
From: "H. Vetinari" <h.vetinari@gmx.com>
Date: Wed, 9 Aug 2023 14:06:35 +1100
Subject: [PATCH 6/6] do not install vendored gmock

---
cmake/install.cmake | 7 -------
1 file changed, 7 deletions(-)

diff --git a/cmake/install.cmake b/cmake/install.cmake
index 24d7a3ec9..687c05289 100644
--- a/cmake/install.cmake
+++ b/cmake/install.cmake
@@ -124,10 +124,3 @@ if(protobuf_INSTALL_EXAMPLES)
DESTINATION "${CMAKE_INSTALL_EXAMPLEDIR}"
COMPONENT protobuf-examples)
endif()
-
-if (protobuf_INSTALL_TESTS)
- install(TARGETS gmock EXPORT protobuf-targets
- RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
- LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
- ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
-endif()

0 comments on commit 07a600d

Please sign in to comment.