mirror of
https://github.com/zeromq/cppzmq.git
synced 2025-01-21 02:00:36 +01:00
Problem: Default Travis build variables not defined.
Solution: simplify Travis config file by defining default build options DRAFT and ZMQ_VERSION in ci_build.sh script
This commit is contained in:
parent
88bb8b1980
commit
265a1071e2
@ -16,7 +16,7 @@ matrix:
|
|||||||
- os: osx
|
- os: osx
|
||||||
osx_image: xcode9.1
|
osx_image: xcode9.1
|
||||||
compiler: clang
|
compiler: clang
|
||||||
env: ZMQ_VERSION=4.2.5 DRAFT=1
|
env: DRAFT=1
|
||||||
|
|
||||||
##########################################################
|
##########################################################
|
||||||
# GCC on Linux
|
# GCC on Linux
|
||||||
@ -27,11 +27,10 @@ matrix:
|
|||||||
sudo: true
|
sudo: true
|
||||||
env: ZMQ_VERSION=4.2.0 BUILD_TYPE=pkgconfig
|
env: ZMQ_VERSION=4.2.0 BUILD_TYPE=pkgconfig
|
||||||
|
|
||||||
# GCC default, draft disabled, latest libzmq
|
# GCC default, draft disabled, default libzmq (defined in ci_build.sh)
|
||||||
- os: linux
|
- os: linux
|
||||||
env: ZMQ_VERSION=4.2.5
|
|
||||||
|
|
||||||
# GCC 7, draft enabled, latest libzmq
|
# GCC 7, draft enabled (default), latest libzmq (default)
|
||||||
- os: linux
|
- os: linux
|
||||||
addons:
|
addons:
|
||||||
apt:
|
apt:
|
||||||
@ -40,7 +39,7 @@ matrix:
|
|||||||
packages:
|
packages:
|
||||||
- g++-7
|
- g++-7
|
||||||
env:
|
env:
|
||||||
- MATRIX_EVAL="CC=gcc-7 && CXX=g++-7" ZMQ_VERSION=4.2.5 DRAFT=1
|
- MATRIX_EVAL="CC=gcc-7 && CXX=g++-7" DRAFT=1
|
||||||
# - env: BUILD_TYPE=cmake DO_CLANG_FORMAT_CHECK=1 CLANG_FORMAT=/usr/local/clang-5.0.0/bin/clang-format
|
# - env: BUILD_TYPE=cmake DO_CLANG_FORMAT_CHECK=1 CLANG_FORMAT=/usr/local/clang-5.0.0/bin/clang-format
|
||||||
# os: linux
|
# os: linux
|
||||||
# addons:
|
# addons:
|
||||||
|
16
ci_build.sh
16
ci_build.sh
@ -6,10 +6,12 @@ set -e
|
|||||||
BUILD_TYPE=${BUILD_TYPE:-cmake}
|
BUILD_TYPE=${BUILD_TYPE:-cmake}
|
||||||
LIBZMQ=${PWD}/libzmq-build
|
LIBZMQ=${PWD}/libzmq-build
|
||||||
CPPZMQ=${PWD}/cppzmq-build
|
CPPZMQ=${PWD}/cppzmq-build
|
||||||
|
ZMQ_VERSION="4.2.5"
|
||||||
|
DRAFT=${DRAFT:-0}
|
||||||
# Travis machines have 2 cores
|
# Travis machines have 2 cores
|
||||||
JOBS=2
|
JOBS=2
|
||||||
|
|
||||||
if [ "$DRAFT" = "1" ] ; then
|
if [ "${DRAFT}" = "1" ] ; then
|
||||||
# if we enable drafts during the libzmq cmake build, the pkgconfig
|
# if we enable drafts during the libzmq cmake build, the pkgconfig
|
||||||
# data should set ZMQ_BUILD_DRAFT_API in dependent builds, but this
|
# data should set ZMQ_BUILD_DRAFT_API in dependent builds, but this
|
||||||
# does not appear to work (TODO)
|
# does not appear to work (TODO)
|
||||||
@ -17,16 +19,16 @@ if [ "$DRAFT" = "1" ] ; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
libzmq_install() {
|
libzmq_install() {
|
||||||
curl -L https://github.com/zeromq/libzmq/archive/v${ZMQ_VERSION}.tar.gz \
|
curl -L https://github.com/zeromq/libzmq/archive/v"${ZMQ_VERSION}".tar.gz \
|
||||||
>zeromq.tar.gz
|
>zeromq.tar.gz
|
||||||
tar -xvzf zeromq.tar.gz
|
tar -xvzf zeromq.tar.gz
|
||||||
if [ "$BUILD_TYPE" = "cmake" ] ; then
|
if [ "${BUILD_TYPE}" = "cmake" ] ; then
|
||||||
cmake -Hlibzmq-${ZMQ_VERSION} -B${LIBZMQ} -DWITH_PERF_TOOL=OFF \
|
cmake -Hlibzmq-${ZMQ_VERSION} -B${LIBZMQ} -DWITH_PERF_TOOL=OFF \
|
||||||
-DZMQ_BUILD_TESTS=OFF \
|
-DZMQ_BUILD_TESTS=OFF \
|
||||||
-DCMAKE_BUILD_TYPE=Release \
|
-DCMAKE_BUILD_TYPE=Release \
|
||||||
${ZEROMQ_CMAKE_FLAGS}
|
${ZEROMQ_CMAKE_FLAGS}
|
||||||
cmake --build ${LIBZMQ} -- -j${JOBS}
|
cmake --build ${LIBZMQ} -- -j${JOBS}
|
||||||
elif [ "$BUILD_TYPE" = "pkgconfig" ] ; then
|
elif [ "${BUILD_TYPE}" = "pkgconfig" ] ; then
|
||||||
pushd .
|
pushd .
|
||||||
cd libzmq-${ZMQ_VERSION}
|
cd libzmq-${ZMQ_VERSION}
|
||||||
./autogen.sh &&
|
./autogen.sh &&
|
||||||
@ -41,12 +43,12 @@ libzmq_install() {
|
|||||||
# build zeromq first
|
# build zeromq first
|
||||||
cppzmq_build() {
|
cppzmq_build() {
|
||||||
pushd .
|
pushd .
|
||||||
if [ "$BUILD_TYPE" = "cmake" ] ; then
|
if [ "${BUILD_TYPE}" = "cmake" ] ; then
|
||||||
export ZeroMQ_DIR=${LIBZMQ}
|
export ZeroMQ_DIR=${LIBZMQ}
|
||||||
fi
|
fi
|
||||||
cmake -H. -B${CPPZMQ} ${ZEROMQ_CMAKE_FLAGS}
|
cmake -H. -B${CPPZMQ} ${ZEROMQ_CMAKE_FLAGS}
|
||||||
cmake --build ${CPPZMQ} -- -j${JOBS}
|
cmake --build ${CPPZMQ} -- -j${JOBS}
|
||||||
if [ "$BUILD_TYPE" = "pkgconfig" ] ; then
|
if [ "${BUILD_TYPE}" = "pkgconfig" ] ; then
|
||||||
cd ${CPPZMQ}
|
cd ${CPPZMQ}
|
||||||
sudo make install
|
sudo make install
|
||||||
fi
|
fi
|
||||||
@ -62,7 +64,7 @@ cppzmq_tests() {
|
|||||||
|
|
||||||
cppzmq_demo() {
|
cppzmq_demo() {
|
||||||
pushd .
|
pushd .
|
||||||
if [ "$BUILD_TYPE" = "cmake" ] ; then
|
if [ "${BUILD_TYPE}" = "cmake" ] ; then
|
||||||
export ZeroMQ_DIR=${LIBZMQ}
|
export ZeroMQ_DIR=${LIBZMQ}
|
||||||
export cppzmq_DIR=${CPPZMQ}
|
export cppzmq_DIR=${CPPZMQ}
|
||||||
fi
|
fi
|
||||||
|
Loading…
x
Reference in New Issue
Block a user