Skip to content

Commit

Permalink
Merge pull request #20184 from veblush/try-abseil
Browse files Browse the repository at this point in the history
Add abseil to gRPC Core
  • Loading branch information
veblush authored Jan 4, 2020
2 parents bf9a0aa + 5207eba commit 40d8986
Show file tree
Hide file tree
Showing 34 changed files with 887 additions and 317 deletions.
14 changes: 9 additions & 5 deletions BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,6 @@ config_setting(
values = {"cpu": "darwin"},
)

config_setting(
name = "grpc_use_absl",
values = {"define": "GRPC_USE_ABSL=1"},
)

python_config_settings()

# This should be updated along with build.yaml
Expand Down Expand Up @@ -560,6 +555,9 @@ grpc_cc_library(
"src/core/lib/gprpp/thd.h",
"src/core/lib/profiling/timers.h",
],
external_deps = [
"absl/strings",
],
language = "c++",
public_hdrs = GPR_PUBLIC_HDRS,
deps = [
Expand Down Expand Up @@ -614,6 +612,9 @@ grpc_cc_library(

grpc_cc_library(
name = "inlined_vector",
external_deps = [
"absl/container:inlined_vector",
],
language = "c++",
public_hdrs = [
"src/core/lib/gprpp/inlined_vector.h",
Expand All @@ -631,6 +632,9 @@ grpc_cc_library(

grpc_cc_library(
name = "optional",
external_deps = [
"absl/types:optional",
],
language = "c++",
public_hdrs = [
"src/core/lib/gprpp/optional.h",
Expand Down
3 changes: 3 additions & 0 deletions BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,9 @@ config("grpc_config") {
"src/core/lib/profiling/timers.h",
]
deps = [
":absl/container:inlined_vector",
":absl/strings:strings",
":absl/types:optional",
]

public_configs = [
Expand Down
56 changes: 42 additions & 14 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,38 @@ else()
set(gRPC_BENCHMARK_PROVIDER "none")
endif()

set(gRPC_ABSL_PROVIDER "module" CACHE STRING "Provider of absl library")
set_property(CACHE gRPC_ABSL_PROVIDER PROPERTY STRINGS "module" "package")

set(gRPC_ABSL_USED_TARGETS
absl_algorithm
absl_atomic_hook
absl_bad_optional_access
absl_base
absl_base_internal
absl_bits
absl_compressed_tuple
absl_config
absl_core_headers
absl_dynamic_annotations
absl_endian
absl_inlined_vector
absl_inlined_vector_internal
absl_int128
absl_log_severity
absl_memory
absl_optional
absl_raw_logging_internal
absl_span
absl_spinlock_wait
absl_strings
absl_strings_internal
absl_throw_delegate
absl_type_traits
absl_utility
absl_meta
)

set(gRPC_USE_PROTO_LITE OFF CACHE BOOL "Use the protobuf-lite library")

if(UNIX)
Expand Down Expand Up @@ -153,6 +185,7 @@ else()
set(_gRPC_CORE_NOSTDCXX_FLAGS "")
endif()

include(cmake/abseil-cpp.cmake)
include(cmake/address_sorting.cmake)
include(cmake/benchmark.cmake)
include(cmake/cares.cmake)
Expand Down Expand Up @@ -1052,6 +1085,9 @@ target_include_directories(gpr
)
target_link_libraries(gpr
${_gRPC_ALLTARGETS_LIBRARIES}
absl::inlined_vector
absl::strings
absl::optional
)
if(_gRPC_PLATFORM_ANDROID)
target_link_libraries(gpr
Expand Down Expand Up @@ -3254,6 +3290,7 @@ target_include_directories(dns_test_util
target_link_libraries(dns_test_util
${_gRPC_PROTOBUF_LIBRARIES}
${_gRPC_ALLTARGETS_LIBRARIES}
gpr
${_gRPC_GFLAGS_LIBRARIES}
)

Expand Down Expand Up @@ -5891,15 +5928,6 @@ target_link_libraries(grpc_csharp_ext
)



if(gRPC_INSTALL)
install(TARGETS grpc_csharp_ext EXPORT gRPCTargets
RUNTIME DESTINATION ${gRPC_INSTALL_BINDIR}
LIBRARY DESTINATION ${gRPC_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${gRPC_INSTALL_LIBDIR}
)
endif()

endif()

add_library(upb
Expand Down Expand Up @@ -18457,7 +18485,7 @@ generate_pkgconfig(
"gRPC platform support library"
"${gRPC_CORE_VERSION}"
""
"-lgpr"
"-lgpr -labsl_bad_optional_access -labsl_strings -labsl_strings_internal -labsl_int128 -labsl_base -labsl_spinlock_wait -labsl_dynamic_annotations -labsl_throw_delegate -labsl_raw_logging_internal -labsl_log_severity"
""
"gpr.pc")

Expand All @@ -18467,7 +18495,7 @@ generate_pkgconfig(
"high performance general RPC framework"
"${gRPC_CORE_VERSION}"
"gpr openssl"
"-lgrpc -laddress_sorting -lupb -lcares -lz"
"-lgrpc -laddress_sorting -lupb -lcares -lz -labsl_bad_optional_access -labsl_strings -labsl_strings_internal -labsl_int128 -labsl_base -labsl_spinlock_wait -labsl_dynamic_annotations -labsl_throw_delegate -labsl_raw_logging_internal -labsl_log_severity"
""
"grpc.pc")

Expand All @@ -18477,7 +18505,7 @@ generate_pkgconfig(
"high performance general RPC framework without SSL"
"${gRPC_CORE_VERSION}"
"gpr"
"-lgrpc_unsecure"
"-lgrpc_unsecure -labsl_bad_optional_access -labsl_strings -labsl_strings_internal -labsl_int128 -labsl_base -labsl_spinlock_wait -labsl_dynamic_annotations -labsl_throw_delegate -labsl_raw_logging_internal -labsl_log_severity"
""
"grpc_unsecure.pc")

Expand All @@ -18487,7 +18515,7 @@ generate_pkgconfig(
"C++ wrapper for gRPC"
"${PACKAGE_VERSION}"
"grpc"
"-lgrpc++"
"-lgrpc++ -labsl_bad_optional_access -labsl_strings -labsl_strings_internal -labsl_int128 -labsl_base -labsl_spinlock_wait -labsl_dynamic_annotations -labsl_throw_delegate -labsl_raw_logging_internal -labsl_log_severity"
""
"grpc++.pc")

Expand All @@ -18497,6 +18525,6 @@ generate_pkgconfig(
"C++ wrapper for gRPC without SSL"
"${PACKAGE_VERSION}"
"grpc_unsecure"
"-lgrpc++_unsecure"
"-lgrpc++_unsecure -labsl_bad_optional_access -labsl_strings -labsl_strings_internal -labsl_int128 -labsl_base -labsl_spinlock_wait -labsl_dynamic_annotations -labsl_throw_delegate -labsl_raw_logging_internal -labsl_log_severity"
""
"grpc++_unsecure.pc")
Loading

0 comments on commit 40d8986

Please sign in to comment.