1 Star 0 Fork 41

kuoyihp/fastblock

forked from openEuler/fastblock 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
build.sh 1.33 KB
一键复制 编辑 原始数据 按行查看 历史
liuhongquan 提交于 2024-02-26 10:46 +08:00 . Organize and merge proto files
#!/bin/bash
buildtype="Release"
component="osd"
usage() {
echo "Usage: $0 [options]"
echo "Options:"
echo " -t, --buildtype : can be Release or Debug"
echo " -c, --component : can be osd or monitor"
exit 1
}
if [ "$#" -eq 0 ] || [ "$1" = "--help" ]; then
usage
fi
# Loop through the command-line arguments
while [ "$#" -gt 0 ]; do
case "$1" in
-t|--buildtype)
shift
buildtype="$1"
;;
-c|--component)
shift
component="$1"
;;
*)
echo "Unknown argument: $1"
usage
;;
esac
shift
done
echo $buildtype
echo $component
root="$(cd $(dirname ${BASH_SOURCE[0]}) && pwd)"
if [[ -z ${CC} ]]; then export CC=/usr/bin/gcc; fi
if [[ -z ${CXX} ]]; then export CXX=/usr/bin/g++; fi
(cd $root/src/msg/demo && ./gen.sh)
(cd $root/proto && ./build.sh)
if [ "$component" = "monitor" ]; then
echo "build fastblock(fastblock-mon、fastblock-client) Golang code"
(cd $root/monitor && make)
exit 0
fi
if [ "$component" = "osd" ]; then
echo "build fastblock(fastblock-osd、fastblock-vhost) C/C++ code"
cmake -DCMAKE_BUILD_TYPE=$buildtype \
-B$root/build \
-H$root \
-DCMAKE_C_COMPILER=$CC \
-DCMAKE_CXX_COMPILER=$CXX \
"$@"
(cd $root/build && make -j `grep -c ^processor /proc/cpuinfo`)
exit 0
fi
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/qizhendong_admin/fastblock.git
git@gitee.com:qizhendong_admin/fastblock.git
qizhendong_admin
fastblock
fastblock
master

搜索帮助