[grpc] Add feature absl-sync (#10307)

* [grpc] Update to 1.28.0 and add feature absl-sync

* Update to 1.28.1 and fix linkage issues
This commit is contained in:
Jack·Boos·Yu 2020-05-21 05:20:37 +08:00 committed by GitHub
parent 92ea5970ed
commit ac2233abc6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 39 additions and 6 deletions

View File

@ -0,0 +1,25 @@
diff --git a/cmake/abseil-cpp.cmake b/cmake/abseil-cpp.cmake
index 078d495..b6f50bd 100644
--- a/cmake/abseil-cpp.cmake
+++ b/cmake/abseil-cpp.cmake
@@ -37,4 +37,7 @@ elseif(gRPC_ABSL_PROVIDER STREQUAL "package")
# Use "CONFIG" as there is no built-in cmake module for absl.
find_package(absl REQUIRED CONFIG)
set(_gRPC_FIND_ABSL "if(NOT absl_FOUND)\n find_package(absl CONFIG)\nendif()")
+ if (gRPC_ABSL_SYNC_ENABLE)
+ add_definitions(-DGPR_ABSEIL_SYNC=1)
+ endif()
endif()
diff --git a/CMakeLists.txt b/CMakeLists.txt
index df1703c..7667662 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1464,6 +1464,8 @@ target_link_libraries(gpr
absl::str_format
absl::strings
absl::optional
+ absl::time
+ absl::synchronization
)
if(_gRPC_PLATFORM_ANDROID)
target_link_libraries(gpr

View File

@ -1,5 +1,8 @@
Source: grpc
Version: 1.28.1
Version: 1.28.1-1
Build-Depends: zlib, openssl, protobuf, c-ares (!uwp), upb, abseil
Homepage: https://github.com/grpc/grpc
Description: An RPC library and framework
Feature: absl-sync
Description: Use abseil synchronization module

View File

@ -5,8 +5,8 @@ endif()
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO grpc/grpc
REF v1.28.1
SHA512 5cc4993470e2df21447d032ddeb65ab4175bb8acad5a06fdd22564068b80a5be255ef0e44d36732642d39dc3eaec02a93d2aaf6e369ad5dc43ff99b5023f357b
REF cb81fe0dfaa424eb50de26fb7c904a27a78c3f76 #v1.28.1
SHA512 ff33c1afe413475846f53fd6b6921323019a6da2218fe4827e43e390e04ea073d8e56b0a9b32015233106a6d90a83eff0fa631df37a96036a9c810a4dc32ea4f
HEAD_REF master
PATCHES
00001-fix-uwp.patch
@ -15,6 +15,7 @@ vcpkg_from_github(
00004-link-gdi32-on-windows.patch
00005-fix-uwp-error.patch
00009-use-system-upb.patch
00010-add-feature-absl-sync.patch
snprintf.patch
)
@ -33,10 +34,14 @@ else()
set(cares_CARES_PROVIDER "package")
endif()
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
absl-sync gRPC_ABSL_SYNC_ENABLE
)
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
OPTIONS
OPTIONS ${FEATURE_OPTIONS}
-DgRPC_INSTALL=ON
-DgRPC_BUILD_TESTS=OFF
-DgRPC_STATIC_LINKING=${gRPC_STATIC_LINKING}
@ -53,13 +58,13 @@ vcpkg_configure_cmake(
-DgRPC_INSTALL_BINDIR:STRING=tools/grpc
-DgRPC_INSTALL_LIBDIR:STRING=lib
-DgRPC_INSTALL_INCLUDEDIR:STRING=include
-DgRPC_INSTALL_CMAKEDIR:STRING=share/grpc
-DgRPC_INSTALL_CMAKEDIR:STRING=share/gRPC
-DgRPC_BUILD_CODEGEN=${gRPC_BUILD_CODEGEN}
)
vcpkg_install_cmake(ADD_BIN_TO_PATH)
vcpkg_fixup_cmake_targets()
vcpkg_fixup_cmake_targets(CONFIG_PATH share/gRPC TARGET_PATH share/gRPC)
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/grpc RENAME copyright)