2018-03-28 11:44:20 +02:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
set -x
|
2018-04-03 12:35:39 +02:00
|
|
|
set -e
|
2018-03-28 11:44:20 +02:00
|
|
|
|
2018-05-13 16:21:06 +02:00
|
|
|
LIBZMQ=${PWD}/libzmq-build
|
|
|
|
CPPZMQ=${PWD}/cppzmq-build
|
2018-05-13 17:32:01 +02:00
|
|
|
# Travis machines have 2 cores
|
|
|
|
JOBS=2
|
2018-05-13 16:21:06 +02:00
|
|
|
|
2018-04-03 16:30:58 +02:00
|
|
|
if [ "$DRAFT" = "1" ] ; then
|
2018-05-12 19:27:42 +02:00
|
|
|
# if we enable drafts during the libzmq cmake build, the pkgconfig
|
|
|
|
# data should set ZMQ_BUILD_DRAFT_API in dependent builds, but this
|
2018-04-03 16:30:58 +02:00
|
|
|
# does not appear to work (TODO)
|
|
|
|
export ZEROMQ_CMAKE_FLAGS="-DENABLE_DRAFTS=ON"
|
|
|
|
fi
|
|
|
|
|
2018-03-28 11:44:20 +02:00
|
|
|
install_zeromq() {
|
2018-05-12 19:27:42 +02:00
|
|
|
curl -L https://github.com/zeromq/libzmq/archive/v${ZMQ_VERSION}.tar.gz \
|
|
|
|
>zeromq.tar.gz
|
2018-03-28 11:44:20 +02:00
|
|
|
tar -xvzf zeromq.tar.gz
|
2018-05-13 16:21:06 +02:00
|
|
|
cmake -Hlibzmq-${ZMQ_VERSION} -B${LIBZMQ} -DWITH_PERF_TOOL=OFF \
|
|
|
|
-DZMQ_BUILD_TESTS=OFF \
|
|
|
|
-DCMAKE_BUILD_TYPE=Release \
|
|
|
|
${ZEROMQ_CMAKE_FLAGS}
|
2018-05-13 17:32:01 +02:00
|
|
|
cmake --build ${LIBZMQ} -- -j${JOBS}
|
2018-03-28 11:44:20 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
# build zeromq first
|
|
|
|
|
|
|
|
if [ "${ZMQ_VERSION}" != "" ] ; then install_zeromq ; fi
|
|
|
|
|
|
|
|
# build cppzmq
|
2018-03-29 17:34:21 +02:00
|
|
|
pushd .
|
2018-05-12 19:36:38 +02:00
|
|
|
ZeroMQ_DIR=${LIBZMQ} cmake -H. -B${CPPZMQ} ${ZEROMQ_CMAKE_FLAGS}
|
2018-05-13 17:32:01 +02:00
|
|
|
cmake --build ${CPPZMQ} -- -j${JOBS}
|
2018-05-12 19:36:38 +02:00
|
|
|
cd ${CPPZMQ}
|
2018-05-13 17:32:01 +02:00
|
|
|
ctest -V -j${JOBS}
|
2018-03-29 17:34:21 +02:00
|
|
|
popd
|
2018-03-28 11:44:20 +02:00
|
|
|
|
2018-04-02 13:21:11 +02:00
|
|
|
# build cppzmq demo
|
2018-05-12 19:36:38 +02:00
|
|
|
ZeroMQ_DIR=${LIBZMQ} cppzmq_DIR=${CPPZMQ} cmake -Hdemo -Bdemo/build
|
2018-05-12 19:27:42 +02:00
|
|
|
cmake --build demo/build
|
|
|
|
cd demo/build
|
2018-05-13 17:32:01 +02:00
|
|
|
ctest -V
|