文章目录
Mac gRPC for C++
#0 源码
Mac: https://github.com/Coxhuang/FKCpp/tree/master/gRPCDemo/macOS
Ubuntu: https://github.com/Coxhuang/FKCpp/tree/master/gRPCDemo/ubuntu
#1 环境
C++14
Python 3.8
macOS 10.5.15
Ubuntu 16.04
cmake 3.18.2
proto 3
Clion
#2 安装
- macOS
使用brew安装
- Ubuntu
- 安装依赖
sudo apt-get install pkg-config
sudo apt-get install autoconf automake libtool make g++ unzip
sudo apt-get install libgflags-dev libgtest-dev
sudo apt-get install clang libc++-dev
- 下载grpc源码(国内镜像)
git clone https://gitee.com/mirrors/grpc-framework grpc
- 修改 submodule
GitHub的submodule下载很慢很慢, 一天都下不下来
cd grpc
vim .gitmodules // 查看文件里的submodule, 将GitHub改成Gitee
[submodule "third_party/zlib"]
path = third_party/zlib
url = https://gitee.com/Coxhuang/zlib
# When using CMake to build, the zlib submodule ends up with a
# generated file that makes Git consider the submodule dirty. This
# state can be ignored for day-to-day development on gRPC.
ignore = dirty
[submodule "third_party/protobuf"]
path = third_party/protobuf
url = https://gitee.com/Coxhuang/protobuf.git
[submodule "third_party/googletest"]
path = third_party/googletest
url = https://gitee.com/Coxhuang/googletest.git
[submodule "third_party/benchmark"]
path = third_party/benchmark
url = https://gitee.com/Coxhuang/benchmark
[submodule "third_party/boringssl-with-bazel"]
path = third_party/boringssl-with-bazel
url = https://gitee.com/Coxhuang/boringssl.git
[submodule "third_party/re2"]
path = third_party/re2
url = https://gitee.com/Coxhuang/re2.git
[submodule "third_party/cares/cares"]
path = third_party/cares/cares
url = https://gitee.com/Coxhuang/c-ares.git
branch = cares-1_12_0
[submodule "third_party/bloaty"]
path = third_party/bloaty
url = https://gitee.com/Coxhuang/bloaty.git
[submodule "third_party/abseil-cpp"]
path = third_party/abseil-cpp
url = https://gitee.com/Coxhuang/abseil-cpp.git
branch = lts_2020_02_25
[submodule "third_party/envoy-api"]
path = third_party/envoy-api
url = https://gitee.com/Coxhuang/data-plane-api.git
[submodule "third_party/googleapis"]
path = third_party/googleapis
url = https://gitee.com/Coxhuang/googleapis.git
[submodule "third_party/protoc-gen-validate"]
path = third_party/protoc-gen-validate
url = https://gitee.com/Coxhuang/protoc-gen-validate.git
[submodule "third_party/udpa"]
path = third_party/udpa
url = https:/

最低0.47元/天 解锁文章
1629

被折叠的 条评论
为什么被折叠?



