Unverified Commit 5ed518dd authored by Ge Jun's avatar Ge Jun Committed by GitHub

Merge pull request #777 from zyearn/revise_cmake_in_travis

separate cmake-compilation into different travis task
parents 7d894e55 322439db
......@@ -9,9 +9,10 @@ compiler:
env:
- PURPOSE=compile
- PURPOSE=unittest
- PURPOSE=compile-with-cmake
- PURPOSE=compile-with-bazel
- PURPOSE=compile USE_MESALINK=yes
- PURPOSE=unittest USE_MESALINK=yes
#- PURPOSE=compile USE_MESALINK=yes
#- PURPOSE=unittest USE_MESALINK=yes
before_script:
- ulimit -c unlimited -S # enable core dumps
......@@ -19,7 +20,8 @@ before_script:
before_install:
- wget --no-clobber https://github.com/bazelbuild/bazel/releases/download/0.25.1/bazel_0.25.1-linux-x86_64.deb
- sudo dpkg -i bazel_0.25.1-linux-x86_64.deb
- wget http://www.us.apache.org/dist/thrift/0.11.0/thrift-0.11.0.tar.gz && tar -xf thrift-0.11.0.tar.gz && cd thrift-0.11.0/ && ./configure --prefix=/usr --with-ruby=no --with-python=no --with-java=no --with-go=no --with-perl=no --with-php=no --with-csharp=no --with-erlang=no --with-lua=no --with-nodejs=no && make CPPFLAGS=-DFORCE_BOOST_SMART_PTR -j 3 -s && sudo make install && cd -
- sudo apt-get install automake bison flex g++ git libboost-all-dev libevent-dev libssl-dev libtool make pkg-config # thrift dependencies
- wget http://www.us.apache.org/dist/thrift/0.11.0/thrift-0.11.0.tar.gz && tar -xf thrift-0.11.0.tar.gz && cd thrift-0.11.0/ && ./configure --prefix=/usr --with-rs=no --with-ruby=no --with-python=no --with-java=no --with-go=no --with-perl=no --with-php=no --with-csharp=no --with-erlang=no --with-lua=no --with-nodejs=no && make -sj4 && sudo make install && cd -
install:
- sudo apt-get install -qq realpath libgflags-dev libprotobuf-dev libprotoc-dev protobuf-compiler libleveldb-dev libgoogle-perftools-dev libboost-dev libssl-dev libevent-dev libboost-test-dev
......@@ -28,5 +30,4 @@ install:
- if [[ "$USE_MESALINK" == "yes" ]]; then curl https://sh.rustup.rs -sSf | sh -s -- -y && source $HOME/.cargo/env && wget https://github.com/mesalock-linux/mesalink/archive/v0.8.0.tar.gz && tar -xf v0.8.0.tar.gz && cd mesalink-0.8.0 && ./autogen.sh --prefix=/usr/ && make && sudo make install && cd - ; fi
script:
- if [[ "$PURPOSE" == "compile-with-bazel" ]]; then bazel build -j 12 -c opt --copt -DHAVE_ZLIB=1 //... ; fi
- sh build_in_travis_ci.sh
......@@ -21,39 +21,28 @@ runcmd(){
echo "build combination: PURPOSE=$PURPOSE CXX=$CXX CC=$CC"
init_make_config() {
EXTRA_BUILD_OPTS=""
if [ "$USE_MESALINK" = "yes" ]; then
EXTRA_BUILD_OPTS="$EXTRA_BUILD_OPTS --with-mesalink"
fi
# 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 $1 ; then
echo "Fail to configure brpc"
exit 1
fi
if [ "$PURPOSE" = "compile" ]; then
make -j4 && sh tools/make_all_examples
elif [ "$PURPOSE" = "unittest" ]; then
# pass the unittest from default Makefile to accelerate build process
:
else
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
# In order to run thrift example, we need to add the corresponding flag
init_make_config "--with-thrift" && make -j4 && sh tools/make_all_examples
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 ../
init_make_config && cd test && make -j4 && sh ./run_tests.sh
elif [ "$PURPOSE" = "compile-with-cmake" ]; then
rm -rf bld && mkdir bld && cd bld && cmake .. && make -j4
elif [ "$PURPOSE" = "compile-with-bazel" ]; then
bazel build -j 12 -c opt --copt -DHAVE_ZLIB=1 //...
else
echo "Unknown purpose=\"$PURPOSE\""
fi
......@@ -25,7 +25,7 @@
namespace brpc {
class ServerId;
struct ServerId;
// After all servers are down and health check happens, servers are
// online one by one. Once one server is up, all the request that should
......
#include <map>
#include <gtest/gtest.h>
#include "butil/recordio.h"
#include "butil/fast_rand.h"
......
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