Install absel along with gRPC (#26802)

pull/26891/head
Esun Kim 3 years ago committed by GitHub
parent 9cda17468b
commit 84b9bda290
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 15
      cmake/abseil-cpp.cmake
  2. 12
      test/distrib/cpp/run_distrib_test_cmake_aarch64_cross.sh
  3. 8
      test/distrib/cpp/run_distrib_test_cmake_module_install.sh
  4. 8
      test/distrib/cpp/run_distrib_test_cmake_module_install_pkgconfig.sh

@ -17,15 +17,12 @@ if(gRPC_ABSL_PROVIDER STREQUAL "module")
set(ABSL_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp)
endif()
if(EXISTS "${ABSL_ROOT_DIR}/CMakeLists.txt")
add_subdirectory(${ABSL_ROOT_DIR} third_party/abseil-cpp)
if(TARGET absl_base)
if(gRPC_INSTALL AND _gRPC_INSTALL_SUPPORTED_FROM_MODULE)
install(TARGETS ${gRPC_ABSL_USED_TARGETS} EXPORT gRPCTargets
RUNTIME DESTINATION ${gRPC_INSTALL_BINDIR}
LIBRARY DESTINATION ${gRPC_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${gRPC_INSTALL_LIBDIR})
endif()
if(gRPC_INSTALL)
# When gRPC_INSTALL is enabled and Abseil will be built as a module,
# Abseil will be installed along with gRPC for convenience.
set(ABSL_ENABLE_INSTALL ON)
endif()
add_subdirectory(${ABSL_ROOT_DIR} third_party/abseil-cpp)
else()
message(WARNING "gRPC_ABSL_PROVIDER is \"module\" but ABSL_ROOT_DIR is wrong")
endif()
@ -36,5 +33,5 @@ if(gRPC_ABSL_PROVIDER STREQUAL "module")
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()")
endif()
set(_gRPC_FIND_ABSL "if(NOT TARGET absl::strings)\n find_package(absl CONFIG)\nendif()")

@ -53,17 +53,6 @@ set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
EOT
# Build and install absl (absl won't be installed down below)
mkdir -p "third_party/abseil-cpp/cmake/build_arm"
pushd "third_party/abseil-cpp/cmake/build_arm"
cmake -DCMAKE_TOOLCHAIN_FILE=/tmp/toolchain.cmake \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/tmp/install \
-DCMAKE_POSITION_INDEPENDENT_CODE=TRUE \
../..
make -j4 install
popd
# Build and install gRPC for ARM.
# This build will use the host architecture copies of protoc and
# grpc_cpp_plugin that we built earlier because we installed them
@ -84,6 +73,7 @@ mkdir -p "examples/cpp/helloworld/cmake/build_arm"
pushd "examples/cpp/helloworld/cmake/build_arm"
cmake -DCMAKE_TOOLCHAIN_FILE=/tmp/toolchain.cmake \
-DCMAKE_BUILD_TYPE=Release \
-Dabsl_DIR=/tmp/stage/lib/cmake/absl \
-DProtobuf_DIR=/tmp/stage/lib/cmake/protobuf \
-DgRPC_DIR=/tmp/stage/lib/cmake/grpc \
../..

@ -26,13 +26,6 @@ wget -q -O cmake-linux.sh https://github.com/Kitware/CMake/releases/download/v3.
sh cmake-linux.sh -- --skip-license --prefix=/usr
rm cmake-linux.sh
# Install absl (absl won't be installed down below)
mkdir -p "third_party/abseil-cpp/cmake/build"
pushd "third_party/abseil-cpp/cmake/build"
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_POSITION_INDEPENDENT_CODE=TRUE ../..
make -j4 install
popd
# Install gRPC and its dependencies
mkdir -p "cmake/build"
pushd "cmake/build"
@ -40,7 +33,6 @@ cmake \
-DCMAKE_BUILD_TYPE=Release \
-DgRPC_INSTALL=ON \
-DgRPC_BUILD_TESTS=OFF \
-DgRPC_ABSL_PROVIDER=package \
-DgRPC_SSL_PROVIDER=package \
../..
make -j4 install

@ -26,13 +26,6 @@ wget -q -O cmake-linux.sh https://github.com/Kitware/CMake/releases/download/v3.
sh cmake-linux.sh -- --skip-license --prefix=/usr
rm cmake-linux.sh
# Install absl (absl won't be installed down below)
mkdir -p "third_party/abseil-cpp/cmake/build"
pushd "third_party/abseil-cpp/cmake/build"
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_POSITION_INDEPENDENT_CODE=TRUE ../..
make -j4 install
popd
# Install gRPC and its dependencies
mkdir -p "cmake/build"
pushd "cmake/build"
@ -40,7 +33,6 @@ cmake \
-DCMAKE_BUILD_TYPE=Release \
-DgRPC_INSTALL=ON \
-DgRPC_BUILD_TESTS=OFF \
-DgRPC_ABSL_PROVIDER=package \
-DgRPC_SSL_PROVIDER=package \
../..
make -j4 install

Loading…
Cancel
Save