Skip to content

Commit 265a107

Browse files
committed
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
1 parent 88bb8b1 commit 265a107

File tree

2 files changed

+13
-12
lines changed

2 files changed

+13
-12
lines changed

.travis.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ matrix:
1616
- os: osx
1717
osx_image: xcode9.1
1818
compiler: clang
19-
env: ZMQ_VERSION=4.2.5 DRAFT=1
19+
env: DRAFT=1
2020

2121
##########################################################
2222
# GCC on Linux
@@ -27,11 +27,10 @@ matrix:
2727
sudo: true
2828
env: ZMQ_VERSION=4.2.0 BUILD_TYPE=pkgconfig
2929

30-
# GCC default, draft disabled, latest libzmq
30+
# GCC default, draft disabled, default libzmq (defined in ci_build.sh)
3131
- os: linux
32-
env: ZMQ_VERSION=4.2.5
3332

34-
# GCC 7, draft enabled, latest libzmq
33+
# GCC 7, draft enabled (default), latest libzmq (default)
3534
- os: linux
3635
addons:
3736
apt:
@@ -40,7 +39,7 @@ matrix:
4039
packages:
4140
- g++-7
4241
env:
43-
- MATRIX_EVAL="CC=gcc-7 && CXX=g++-7" ZMQ_VERSION=4.2.5 DRAFT=1
42+
- MATRIX_EVAL="CC=gcc-7 && CXX=g++-7" DRAFT=1
4443
# - env: BUILD_TYPE=cmake DO_CLANG_FORMAT_CHECK=1 CLANG_FORMAT=/usr/local/clang-5.0.0/bin/clang-format
4544
# os: linux
4645
# addons:

ci_build.sh

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,27 +6,29 @@ set -e
66
BUILD_TYPE=${BUILD_TYPE:-cmake}
77
LIBZMQ=${PWD}/libzmq-build
88
CPPZMQ=${PWD}/cppzmq-build
9+
ZMQ_VERSION="4.2.5"
10+
DRAFT=${DRAFT:-0}
911
# Travis machines have 2 cores
1012
JOBS=2
1113

12-
if [ "$DRAFT" = "1" ] ; then
14+
if [ "${DRAFT}" = "1" ] ; then
1315
# if we enable drafts during the libzmq cmake build, the pkgconfig
1416
# data should set ZMQ_BUILD_DRAFT_API in dependent builds, but this
1517
# does not appear to work (TODO)
1618
export ZEROMQ_CMAKE_FLAGS="-DENABLE_DRAFTS=ON"
1719
fi
1820

1921
libzmq_install() {
20-
curl -L https://github.com/zeromq/libzmq/archive/v${ZMQ_VERSION}.tar.gz \
22+
curl -L https://github.com/zeromq/libzmq/archive/v"${ZMQ_VERSION}".tar.gz \
2123
>zeromq.tar.gz
2224
tar -xvzf zeromq.tar.gz
23-
if [ "$BUILD_TYPE" = "cmake" ] ; then
25+
if [ "${BUILD_TYPE}" = "cmake" ] ; then
2426
cmake -Hlibzmq-${ZMQ_VERSION} -B${LIBZMQ} -DWITH_PERF_TOOL=OFF \
2527
-DZMQ_BUILD_TESTS=OFF \
2628
-DCMAKE_BUILD_TYPE=Release \
2729
${ZEROMQ_CMAKE_FLAGS}
2830
cmake --build ${LIBZMQ} -- -j${JOBS}
29-
elif [ "$BUILD_TYPE" = "pkgconfig" ] ; then
31+
elif [ "${BUILD_TYPE}" = "pkgconfig" ] ; then
3032
pushd .
3133
cd libzmq-${ZMQ_VERSION}
3234
./autogen.sh &&
@@ -41,12 +43,12 @@ libzmq_install() {
4143
# build zeromq first
4244
cppzmq_build() {
4345
pushd .
44-
if [ "$BUILD_TYPE" = "cmake" ] ; then
46+
if [ "${BUILD_TYPE}" = "cmake" ] ; then
4547
export ZeroMQ_DIR=${LIBZMQ}
4648
fi
4749
cmake -H. -B${CPPZMQ} ${ZEROMQ_CMAKE_FLAGS}
4850
cmake --build ${CPPZMQ} -- -j${JOBS}
49-
if [ "$BUILD_TYPE" = "pkgconfig" ] ; then
51+
if [ "${BUILD_TYPE}" = "pkgconfig" ] ; then
5052
cd ${CPPZMQ}
5153
sudo make install
5254
fi
@@ -62,7 +64,7 @@ cppzmq_tests() {
6264

6365
cppzmq_demo() {
6466
pushd .
65-
if [ "$BUILD_TYPE" = "cmake" ] ; then
67+
if [ "${BUILD_TYPE}" = "cmake" ] ; then
6668
export ZeroMQ_DIR=${LIBZMQ}
6769
export cppzmq_DIR=${CPPZMQ}
6870
fi

0 commit comments

Comments
 (0)