void-packages/srcpkgs/grpc/patches/private-abseil.patch

35 lines
1.3 KiB
Diff
Raw Normal View History

2021-04-30 18:16:06 +02:00
gRPC requires abseil, but abseil can be statically linked to avoid installing
and tracking a ton of extra shared libs. Unfortunately, grpcpp headers now
include absl headers, so these need to be installed. Put them in a private
location because the full abseil installation is not provided.
diff -ur third_party/abseil-cpp/CMakeLists.txt third_party/abseil-cpp/CMakeLists.txt
--- third_party/abseil-cpp/CMakeLists.txt
+++ third_party/abseil-cpp/CMakeLists.txt
@@ -42,6 +42,7 @@
endif (POLICY CMP0077)
project(absl CXX)
+set(BUILD_SHARED_LIBS OFF)
# Output directory is correct by default for most build setups. However, when
# building Abseil as a DLL, it is important to have the DLL in the same
@@ -52,7 +53,7 @@
# when absl is included as subproject (i.e. using add_subdirectory(abseil-cpp))
# in the source tree of a project that uses it, install rules are disabled.
if(NOT "^${CMAKE_SOURCE_DIR}$" STREQUAL "^${PROJECT_SOURCE_DIR}$")
- option(ABSL_ENABLE_INSTALL "Enable install rule" OFF)
+ option(ABSL_ENABLE_INSTALL "Enable install rule" ON)
else()
option(ABSL_ENABLE_INSTALL "Enable install rule" ON)
endif()
@@ -167,7 +168,7 @@
endif() # absl_VERSION
install(DIRECTORY absl
- DESTINATION ${ABSL_INSTALL_INCLUDEDIR}
+ DESTINATION ${ABSL_INSTALL_INCLUDEDIR}/grpc_absl
FILES_MATCHING
PATTERN "*.inc"
PATTERN "*.h"