[c++ travis] Split C++ build into its own scripts
Splits the C++ build into its own set of scripts, like the other flavors. This is in preparation for adding another C++ flavor: one that builds with the gRPC master code instead of the current submodule version.
This commit is contained in:
Родитель
7e1f4ad2f5
Коммит
a747cf0555
|
@ -4,11 +4,11 @@ set -eux
|
|||
|
||||
SYMLINKED_HOME=$1
|
||||
FLAVOR=$2
|
||||
BOOST=${3:-}
|
||||
BOOST=${3:-1.63.0}
|
||||
COMPILER=${4:-clang}
|
||||
|
||||
export BOND_ROOT=/root/bond
|
||||
export BUILD_ROOT=/root/build
|
||||
BOND_ROOT=/root/bond
|
||||
BUILD_ROOT=/root/build
|
||||
BUILD_SCRIPTS=$BOND_ROOT/tools/ci-scripts/linux
|
||||
|
||||
# We set our cflags in non-standard variables because Stack chokes on some
|
||||
|
@ -17,23 +17,24 @@ case "$COMPILER" in
|
|||
clang)
|
||||
export CXX=clang++
|
||||
export CC=clang
|
||||
export BOND_CXX_FLAGS="-Qunused-arguments --system-header-prefix=boost/"
|
||||
export BOND_CC_FLAGS="-Qunused-arguments --system-header-prefix=boost/"
|
||||
BOND_CXX_FLAGS="-Qunused-arguments --system-header-prefix=boost/"
|
||||
BOND_CC_FLAGS="-Qunused-arguments --system-header-prefix=boost/"
|
||||
;;
|
||||
|
||||
gcc)
|
||||
export CXX=g++
|
||||
export CC=gcc
|
||||
export BOND_CXX_FLAGS=
|
||||
export BOND_CC_FLAGS=
|
||||
BOND_CXX_FLAGS=
|
||||
BOND_CC_FLAGS=
|
||||
;;
|
||||
|
||||
*) echo "Unknown compiler $COMPILER"; exit 1;;
|
||||
esac
|
||||
|
||||
export BOND_CMAKE_FLAGS="-DBOND_USE_CCACHE=TRUE"
|
||||
# Default boost root. C++ requires a specific boost and will override this.
|
||||
export BOOST_ROOT=/opt/boosts/boost_1_63_0
|
||||
BOND_CMAKE_FLAGS="-DBOND_USE_CCACHE=TRUE"
|
||||
# All of the CMake-based builds need BOOST_ROOT set, even if they don't
|
||||
# build any C++ code
|
||||
export BOOST_ROOT=/opt/boosts/boost_`echo $BOOST | tr . _`
|
||||
|
||||
mkdir -p $SYMLINKED_HOME $BUILD_ROOT
|
||||
ln -s /root/.ccache $SYMLINKED_HOME/.ccache
|
||||
|
@ -41,31 +42,10 @@ ln -s /root/.stack $SYMLINKED_HOME/.stack
|
|||
|
||||
cd $BUILD_ROOT
|
||||
|
||||
case "$FLAVOR" in
|
||||
cpp-*)
|
||||
case "$FLAVOR" in
|
||||
cpp-core) BOND_CMAKE_FLAGS="$BOND_CMAKE_FLAGS -DBOND_SKIP_GBC_TESTS=TRUE -DBOND_ENABLE_GRPC=FALSE";;
|
||||
cpp-grpc) BOND_CMAKE_FLAGS="$BOND_CMAKE_FLAGS -DBOND_SKIP_GBC_TESTS=TRUE -DBOND_SKIP_CORE_TESTS=TRUE -DgRPC_ZLIB_PROVIDER=package";;
|
||||
*) echo "Unknown FLAVOR=$FLAVOR"; exit 1;;
|
||||
esac
|
||||
|
||||
if [ ! $BOOST ]; then echo "BOOST not specified"; exit 1; fi
|
||||
|
||||
export BOOST_ROOT=/opt/boosts/boost_`echo $BOOST | tr . _`
|
||||
|
||||
cmake -DBOND_STACK_OPTIONS="--allow-different-user" -DCMAKE_CXX_FLAGS="$BOND_CXX_FLAGS" -DCMAKE_C_FLAGS="$BOND_CC_FLAGS" ${=BOND_CMAKE_FLAGS} /root/bond
|
||||
|
||||
make --jobs 2 check
|
||||
;;
|
||||
|
||||
*)
|
||||
# Flavors that have separate scripts.
|
||||
local SCRIPT_PATH="$BUILD_SCRIPTS/build_$FLAVOR.zsh"
|
||||
if [[ -e "$SCRIPT_PATH" ]]; then
|
||||
zsh "$SCRIPT_PATH"
|
||||
else
|
||||
echo "Unknown FLAVOR $FLAVOR"
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
local SCRIPT_PATH="$BUILD_SCRIPTS/build_$FLAVOR.zsh"
|
||||
if [[ -e "$SCRIPT_PATH" ]]; then
|
||||
source "$SCRIPT_PATH"
|
||||
else
|
||||
echo "Unknown FLAVOR $FLAVOR"
|
||||
exit 1
|
||||
fi
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
#!/bin/zsh
|
||||
|
||||
set -eux
|
||||
|
||||
cmake -DBOND_STACK_OPTIONS="--allow-different-user" \
|
||||
-DCMAKE_CXX_FLAGS="$BOND_CXX_FLAGS" \
|
||||
-DCMAKE_C_FLAGS="$BOND_CC_FLAGS" \
|
||||
${=BOND_CMAKE_FLAGS} \
|
||||
/root/bond
|
||||
|
||||
make --jobs 2 check
|
|
@ -0,0 +1,5 @@
|
|||
#!/bin/zsh
|
||||
|
||||
set -eux
|
||||
BOND_CMAKE_FLAGS="$BOND_CMAKE_FLAGS -DBOND_SKIP_GBC_TESTS=TRUE -DBOND_ENABLE_GRPC=FALSE"
|
||||
source "$BUILD_SCRIPTS/build_cpp-common.zsh"
|
|
@ -0,0 +1,5 @@
|
|||
#!/bin/zsh
|
||||
|
||||
set -eux
|
||||
BOND_CMAKE_FLAGS="$BOND_CMAKE_FLAGS -DBOND_SKIP_GBC_TESTS=TRUE -DBOND_SKIP_CORE_TESTS=TRUE -DgRPC_ZLIB_PROVIDER=package"
|
||||
source "$BUILD_SCRIPTS/build_cpp-common.zsh"
|
Загрузка…
Ссылка в новой задаче