使用vscode+clangd来阅读源码的时候,发现centos上面yum没法安装bear,因此在此记录一下它编译安装的过程。
首先去github下载它的发布版源码包:
https://github.com/rizsotto/Bear/releases/tag/3.1.4
先安装依赖项:
dnf install python cmake pkg-config
dnf install json-devel spdlog-devel fmt-devel grpc-devel grpc-plugins
dnf install gtest-devel gmock-devel # optional for running the tests
解压然后cd进去那个文件夹,接着执行以下命令(记得先安装cmake):
mkdir build
cd build
cmake -DENABLE_UNIT_TESTS=OFF -DENABLE_FUNC_TESTS=OFF ..
make all -j $(nproc)
sudo make install