Browse Source

contrib: protobuf: prioritize internal include path over zlib include directories

pull/192/head
Pierre Lamot 5 months ago
committed by Steve Lhomme
parent
commit
b43e610586
  1. 31
      contrib/src/protobuf/0001-prioritize-internal-include-path-over-zlib-include-d.patch
  2. 2
      contrib/src/protobuf/rules.mak

31
contrib/src/protobuf/0001-prioritize-internal-include-path-over-zlib-include-d.patch

@ -0,0 +1,31 @@
From 951c32bb0ee6467c2ae35b8402513ed2cf3292db Mon Sep 17 00:00:00 2001
From: Pierre Lamot <pierre@videolabs.io>
Date: Tue, 28 Oct 2025 11:30:43 +0100
Subject: [PATCH] prioritize internal include path over zlib include
directories
this fix compilation when older protobuf headers are present in zlib include
path
---
CMakeLists.txt | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 04cb330..f8579a1 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -296,9 +296,9 @@ else (MSVC)
endif (MSVC)
include_directories(
- ${ZLIB_INCLUDE_DIRECTORIES}
${protobuf_BINARY_DIR}
- ${protobuf_SOURCE_DIR}/src)
+ ${protobuf_SOURCE_DIR}/src
+ ${ZLIB_INCLUDE_DIRECTORIES})
if (protobuf_UNICODE)
add_definitions(-DUNICODE -D_UNICODE)
--
2.43.0

2
contrib/src/protobuf/rules.mak

@ -48,6 +48,7 @@ protoc: protoc-$(PROTOBUF_VERSION)-cpp.tar.gz .sum-protoc
$(RM) -Rf $@ $(UNPACK_DIR) && mkdir -p $(UNPACK_DIR)
tar $(TAR_VERBOSE)xzfo "$<" -C $(UNPACK_DIR) --strip-components=1
$(APPLY) $(SRC)/protobuf/0001-Fix-9947-make-the-ABI-identical-between-debug-and-no.patch
$(APPLY) $(SRC)/protobuf/0001-prioritize-internal-include-path-over-zlib-include-d.patch
# add a dummy install command to disable some installation
sed -i.old '1s;^;function (noinstall ...)\nendfunction()\n;' $(UNPACK_DIR)/cmake/install.cmake
# don't install pkg-config files (on top of the target ones)
@ -73,6 +74,7 @@ protoc: protoc-$(PROTOBUF_VERSION)-cpp.tar.gz .sum-protoc
protobuf: protobuf-$(PROTOBUF_PACKAGE).tar.gz .sum-protobuf
$(UNPACK)
$(APPLY) $(SRC)/protobuf/0001-Fix-9947-make-the-ABI-identical-between-debug-and-no.patch
$(APPLY) $(SRC)/protobuf/0001-prioritize-internal-include-path-over-zlib-include-d.patch
# add a dummy install command to disable some installation
sed -i.old '1s;^;function (noinstall ...)\nendfunction()\n;' $(UNPACK_DIR)/cmake/install.cmake
# don't build libprotoc

Loading…
Cancel
Save