Commit 7d0c67b8 authored by zhujiashun's avatar zhujiashun

revert build_in_travis_ci.sh

parent 7c4b8346
...@@ -25,19 +25,35 @@ EXTRA_BUILD_OPTS="" ...@@ -25,19 +25,35 @@ EXTRA_BUILD_OPTS=""
if [ "$USE_MESALINK" = "yes" ]; then if [ "$USE_MESALINK" = "yes" ]; then
EXTRA_BUILD_OPTS="$EXTRA_BUILD_OPTS --with-mesalink" EXTRA_BUILD_OPTS="$EXTRA_BUILD_OPTS --with-mesalink"
fi fi
# The default env in travis-ci is Ubuntu. # The default env in travis-ci is Ubuntu.
if ! sh config_brpc.sh --headers=/usr/include --libs=/usr/lib --nodebugsymbols --cxx=$CXX --cc=$CC $EXTRA_BUILD_OPTS; then if ! sh config_brpc.sh --headers=/usr/include --libs=/usr/lib --nodebugsymbols --cxx=$CXX --cc=$CC $EXTRA_BUILD_OPTS; then
echo "Fail to configure brpc" echo "Fail to configure brpc"
exit 1 exit 1
fi fi
if [ "$PURPOSE" = "compile" ]; then if [ "$PURPOSE" = "compile" ]; then
make -j4 && sh tools/make_all_examples make -j4 && sh tools/make_all_examples
elif [ "$PURPOSE" = "unittest" ]; then elif [ "$PURPOSE" = "unittest" ]; then
cd test # pass the unittest from default Makefile to accelerate build process
make -j4 && sh ./run_tests.sh :
elif [ "$PURPOSE" = "compile-with-cmake" ]; then else
rm -rf bld && mkdir bld && cd bld && cmake .. && make -j4 echo "Unknown purpose=\"$PURPOSE\""
fi
echo "start building by cmake"
rm -rf bld && mkdir bld && cd bld
if [ "$PURPOSE" = "compile" ]; then
if ! cmake ..; then
echo "Fail to generate Makefile by cmake"
exit 1
fi
make -j4
elif [ "$PURPOSE" = "unittest" ]; then
if ! cmake -DBUILD_UNIT_TESTS=ON ..; then
echo "Fail to generate Makefile by cmake"
exit 1
fi
make -j4 && cd test && sh ./run_tests.sh && cd ../
else else
echo "Unknown purpose=\"$PURPOSE\"" echo "Unknown purpose=\"$PURPOSE\""
fi fi
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment