代码拉取完成,页面将自动刷新
同步操作将从 an-tao/drogon 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
#!/usr/bin/env bash
#build drogon
function build_drogon() {
#Update the submodule and initialize
git submodule update --init
#Remove the config.h generated by the old version of drogon.
rm -f lib/inc/drogon/config.h
#Save current directory
current_dir="${PWD}"
#The folder in which we will build drogon
build_dir='./build'
if [ -d $build_dir ]; then
echo "Deleted folder: ${build_dir}"
rm -rf $build_dir
fi
#Create building folder
echo "Created building folder: ${build_dir}"
mkdir $build_dir
echo "Entering folder: ${build_dir}"
cd $build_dir
echo "Start building drogon ..."
if [ $1 -eq 1 ]; then
cmake .. -DBUILD_TESTING=YES $cmake_gen
elif [ $1 -eq 2 ]; then
cmake .. -DBUILD_TESTING=YES -DBUILD_SHARED_LIBS=ON -DCMAKE_CXX_VISIBILITY_PRESET=hidden -DCMAKE_VISIBILITY_INLINES_HIDDEN=1 $cmake_gen
else
cmake .. -DCMAKE_BUILD_TYPE=release $cmake_gen
fi
#If errors then exit
if [ "$?" != "0" ]; then
exit -1
fi
$make_program $make_flags
#If errors then exit
if [ "$?" != "0" ]; then
exit -1
fi
echo "Installing ..."
$make_program install
#Go back to the current directory
cd $current_dir
#Ok!
}
make_program=make
make_flags=''
cmake_gen=''
parallel=1
case $(uname) in
FreeBSD)
nproc=$(sysctl -n hw.ncpu)
;;
Darwin)
nproc=$(sysctl -n hw.ncpu) # sysctl -n hw.ncpu is the equivalent to nproc on macOS.
;;
*)
nproc=$(nproc)
;;
esac
# simulate ninja's parallelism
case nproc in
1)
parallel=$(( nproc + 1 ))
;;
2)
parallel=$(( nproc + 1 ))
;;
*)
parallel=$(( nproc + 2 ))
;;
esac
if [ -f /bin/ninja ]; then
make_program=ninja
cmake_gen='-GNinja'
else
make_flags="$make_flags -j$parallel"
fi
if [ "X$1" = "X-t" ]; then
build_drogon 1
elif [ "X$1" = "X-tshared" ]; then
build_drogon 2
else
build_drogon 0
fi
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。