Skip to content

Commit 37ed777

Browse files
authored
Merge pull request syslog-ng#5142 from HofiOne/add-cmake-grpc-build-fix
Add cmake grpc build fix
2 parents e557f3d + 380b43e commit 37ed777

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

.github/workflows/macos.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ jobs:
8181
--disable-java-modules
8282
"
8383
CMAKE_CONFIGURE_FLAGS="
84+
`[ $CC = clang ] && echo '-DENABLE_FORCE_GNU99=ON' || true`
8485
-DSUMMARY_VERBOSE=ON
8586
-DCMAKE_BUILD_TYPE=Debug
8687
-DCMAKE_INSTALL_PREFIX=${SYSLOG_NG_INSTALL_DIR}
@@ -90,7 +91,6 @@ jobs:
9091
-DENABLE_JOURNALD=OFF
9192
-DENABLE_JAVA=OFF
9293
-DENABLE_JAVA_MODULES=OFF
93-
-DENABLE_GRPC=OFF
9494
"
9595
PKG_CONFIG_PATH="${HOMEBREW_PREFIX}/opt/openssl@3/lib/pkgconfig:${HOMEBREW_PREFIX}/opt/net-snmp/lib/pkgconfig:${HOMEBREW_PREFIX}/lib/pkgconfig:${MACPORTS_PREFIX}/lib/pkgconfig:${PKG_CONFIG_PATH}"
9696
PATH="${HOMEBREW_PREFIX}/opt/bison/bin:${HOMEBREW_PREFIX}/opt/libnet/bin:${HOMEBREW_PREFIX}/opt/net-snmp/bin:${HOMEBREW_PREFIX}/bin:${HOMEBREW_PREFIX}/sbin:${PYTHONUSERBASE}/bin:${MACPORTS_PREFIX}/bin:${MACPORTS_PREFIX}/sbin:${PATH}"

modules/grpc/CMakeLists.txt

+15
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,21 @@ if (NOT DEFINED ENABLE_GRPC OR ENABLE_GRPC)
4141
endif()
4242

4343
if (GRPC_DEPS_FOUND)
44+
# Workaround of https://github.com/protocolbuffers/protobuf/issues/18307
45+
# The latest (BSD variants) protobuf builds are forcibly bound to libupd, so
46+
# find_package(gRPC...) will fail with
47+
# Targets not yet defined: protobuf::libupb, protobuf::protoc-gen-upb,
48+
# protobuf::protoc-gen-upbdefs, protobuf::protoc-gen-upb_minitable
49+
# Try to satisfy it temporally.
50+
#
51+
find_library (UPB_LIBRARIES NAMES upb)
52+
if (UPB_LIBRARIES)
53+
add_library(protobuf::libupb STATIC IMPORTED)
54+
add_executable(protobuf::protoc-gen-upb IMPORTED)
55+
add_executable(protobuf::protoc-gen-upbdefs IMPORTED)
56+
add_executable(protobuf::protoc-gen-upb_minitable IMPORTED)
57+
endif()
58+
4459
find_package(gRPC 1.16.1 QUIET)
4560

4661
if (NOT gRPC_FOUND)

0 commit comments

Comments
 (0)