From 30b9b73546935a72cf3daab44e081e1364a90d2e Mon Sep 17 00:00:00 2001
From: Pavel Pautov
Date: Mon, 11 Mar 2024 22:36:34 -0700
Subject: [PATCH] Disable unnecessary gRPC features to reduce binary size.
Incidentally, this also removes RE2 code from the binary.
---
CMakeLists.txt | 3 +++
1 file changed, 3 insertions(+)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 50c0c55..4b85113 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -47,6 +47,9 @@ if(NGX_OTEL_FETCH_DEPS)
FetchContent_MakeAvailable(grpc otelcpp)
+ # reconsider once https://github.com/grpc/grpc/issues/36023 is done
+ target_compile_definitions(grpc PRIVATE GRPC_NO_XDS GRPC_NO_RLS)
+
set_property(DIRECTORY ${grpc_SOURCE_DIR}
PROPERTY EXCLUDE_FROM_ALL YES)
set_property(DIRECTORY ${otelcpp_SOURCE_DIR}