8 Star 2 Fork 6

anolis/dsms-storage

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
do_cmake.sh 1.82 KB
一键复制 编辑 原始数据 按行查看 历史
吴秀巧 提交于 2022-12-21 19:29 . Add storage code
#!/usr/bin/env bash
set -ex
git submodule update --init --recursive
: ${BUILD_DIR:=build}
: ${CEPH_GIT_DIR:=..}
if [ -e $BUILD_DIR ]; then
echo "'$BUILD_DIR' dir already exists; either rm -rf '$BUILD_DIR' and re-run, or set BUILD_DIR env var to a different directory name"
exit 1
fi
PYBUILD="2"
if [ -r /etc/os-release ]; then
source /etc/os-release
case "$ID" in
fedora)
PYBUILD="3.7"
if [ "$VERSION_ID" -eq "32" ] ; then
PYBUILD="3.8"
elif [ "$VERSION_ID" -ge "33" ] ; then
PYBUILD="3.9"
fi
;;
rhel|centos)
MAJOR_VER=$(echo "$VERSION_ID" | sed -e 's/\..*$//')
if [ "$MAJOR_VER" -ge "8" ] ; then
PYBUILD="3.6"
fi
;;
opensuse*|suse|sles)
PYBUILD="3"
ARGS+=" -DWITH_RADOSGW_AMQP_ENDPOINT=OFF"
ARGS+=" -DWITH_RADOSGW_KAFKA_ENDPOINT=OFF"
;;
esac
elif [ "$(uname)" == FreeBSD ] ; then
PYBUILD="3"
ARGS+=" -DWITH_RADOSGW_AMQP_ENDPOINT=OFF"
ARGS+=" -DWITH_RADOSGW_KAFKA_ENDPOINT=OFF"
else
echo Unknown release
exit 1
fi
if [[ "$PYBUILD" =~ ^3(\..*)?$ ]] ; then
ARGS+=" -DWITH_PYTHON3=${PYBUILD}"
fi
if type ccache > /dev/null 2>&1 ; then
echo "enabling ccache"
ARGS+=" -DWITH_CCACHE=ON"
fi
mkdir $BUILD_DIR
cd $BUILD_DIR
if type cmake3 > /dev/null 2>&1 ; then
CMAKE=cmake3
else
CMAKE=cmake
fi
${CMAKE} $ARGS "$@" $CEPH_GIT_DIR || exit 1
set +x
# minimal config to find plugins
cat <<EOF > ceph.conf
[global]
plugin dir = lib
erasure code dir = lib
EOF
echo done.
if [[ ! $ARGS =~ "-DCMAKE_BUILD_TYPE" ]]; then
cat <<EOF
****
WARNING: do_cmake.sh now creates debug builds by default. Performance
may be severely affected. Please use -DCMAKE_BUILD_TYPE=RelWithDebInfo
if a performance sensitive build is required.
****
EOF
fi
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/anolis/dsms-storage.git
git@gitee.com:anolis/dsms-storage.git
anolis
dsms-storage
dsms-storage
master

搜索帮助