Skip to content

Commit

Permalink
Update gRPC build config
Browse files Browse the repository at this point in the history
  • Loading branch information
wangkang committed Jan 26, 2024
1 parent 4b07b5a commit 6b71a99
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
3 changes: 2 additions & 1 deletion third-party/install.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,11 @@ list(PREPEND CMAKE_PREFIX_PATH ${DIR_THIRD_PARTY_OUT}/protobuf)
list(PREPEND CMAKE_PREFIX_PATH ${DIR_THIRD_PARTY_OUT}/abseil-cpp)
list(PREPEND CMAKE_PREFIX_PATH ${DIR_THIRD_PARTY_OUT}/re2)
list(PREPEND CMAKE_PREFIX_PATH ${DIR_THIRD_PARTY_OUT}/c-ares)
list(PREPEND CMAKE_PREFIX_PATH ${DIR_THIRD_PARTY_OUT}/zlib)
message(STATUS "CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH}")

find_package(ZLIB REQUIRED)
find_package(protobuf CONFIG REQUIRED)
find_package(gRPC CONFIG REQUIRED)
message(STATUS "Using zlib ${ZLIB_VERSION}" " --> " "${ZLIB_LIBRARIES}")
message(STATUS "Using protobuf ${Protobuf_VERSION}")
message(STATUS "Using gRPC ${gRPC_VERSION}")
17 changes: 8 additions & 9 deletions third-party/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,26 +31,25 @@ function cmake_build() {

function cmake_build_grpc() {
local t="$SELF_DIR/build/target"
cmake_build 'c-ares' 'grpc/third_party/cares/cares'
cmake_build 're2' 'grpc/third_party/re2' -D CMAKE_POSITION_INDEPENDENT_CODE=TRUE
cmake_build 'abseil-cpp' 'grpc/third_party/abseil-cpp' \
-D CMAKE_POSITION_INDEPENDENT_CODE=TRUE \
-D ABSL_PROPAGATE_CXX_STD=ON
cmake_build 'zlib' 'grpc/third_party/zlib' -D CMAKE_MACOSX_RPATH=OFF
cmake_build 'c-ares' 'grpc/third_party/cares/cares'
cmake_build 're2' 'grpc/third_party/re2' -D CMAKE_POSITION_INDEPENDENT_CODE=TRUE
cmake_build 'protobuf' 'grpc/third_party/protobuf' \
-D CMAKE_PREFIX_PATH="$t/zlib;$t/abseil-cpp" \
-D CMAKE_PREFIX_PATH="$t/abseil-cpp" \
-D protobuf_BUILD_TESTS=OFF \
-D protobuf_INSTALL=ON \
-D protobuf_ABSL_PROVIDER=package
cmake_build 'grpc' 'grpc' \
-D CMAKE_PREFIX_PATH="$t/zlib;$t/c-ares;$t/re2;$t/abseil-cpp;$t/protobuf" \
-D CMAKE_PREFIX_PATH="$t/c-ares;$t/re2;$t/abseil-cpp;$t/protobuf" \
-D gRPC_BUILD_TESTS=OFF \
-D gRPC_INSTALL=ON \
-D gRPC_SSL_PROVIDER=package \
-D gRPC_ZLIB_PROVIDER=package \
-D gRPC_SSL_PROVIDER=module \
-D gRPC_ZLIB_PROVIDER=module \
-D gRPC_CARES_PROVIDER=package \
-D gRPC_RE2_PROVIDER=package \
-D gRPC_ABSL_PROVIDER=package \
-D gRPC_RE2_PROVIDER=package \
-D gRPC_ABSL_PROVIDER=package \
-D gRPC_PROTOBUF_PROVIDER=package
}

Expand Down

0 comments on commit 6b71a99

Please sign in to comment.