1#!/bin/bash 2 3grpc_1_39_0_githash=58602e20a3f3e48f24a4114c757099b25b947f7b 4 5function build_grpc () { 6 git clone https://github.com/grpc/grpc.git google/grpc 7 cd google/grpc 8 git checkout ${grpc_1_39_0_githash} 9 git submodule update --init 10 # Apply boringssl build patch 11 cd third_party/boringssl-with-bazel 12 git apply ../../../../grpc/boringssl.patch 13 cd ../.. 14 mkdir ../grpc_build 15 cd ../grpc_build 16 cmake ../grpc -DgRPC_INSTALL=ON -DgRPC_BUILD_TESTS=OFF -DABSL_ENABLE_INSTALL=ON -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_PREFIX=`pwd`/../grpc/install 17 cmake --build . --target install ${JOBS:+-j$JOBS} 18 cd ../.. 19} 20 21GRPC_INSTALL_PATH=`pwd`/google/grpc/install 22PROTOBUF_DOWNLOAD_PATH=`pwd`/google/grpc/third_party/protobuf 23 24build_grpc 25