Skip to content

Commit

Permalink
Problem: libzmq builds with tests
Browse files Browse the repository at this point in the history
libzmq build with default settings now which build all the tests and
performance tools. This is not required for cppzmq build and slows down
it only.

Solution: disable tests build for libzmq and make it release only.
  • Loading branch information
kurdybacha committed May 13, 2018
1 parent f35cbe2 commit 3dc20bb
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 9 deletions.
17 changes: 11 additions & 6 deletions ci_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,17 @@ if [ "$DRAFT" = "1" ] ; then
export ZEROMQ_CMAKE_FLAGS="-DENABLE_DRAFTS=ON"
fi

LIBZMQ=${PWD}/libzmq-build
CPPZMQ=${PWD}/cppzmq-build
install_zeromq() {
curl -L https://github.com/zeromq/libzmq/archive/v${ZMQ_VERSION}.tar.gz \
>zeromq.tar.gz
tar -xvzf zeromq.tar.gz
cmake -Hlibzmq-${ZMQ_VERSION} -Blibzmq ${ZEROMQ_CMAKE_FLAGS}
cmake --build libzmq
cmake -Hlibzmq-${ZMQ_VERSION} -B${LIBZMQ} -DWITH_PERF_TOOL=OFF \
-DZMQ_BUILD_TESTS=OFF \
-DCMAKE_BUILD_TYPE=Release \
${ZEROMQ_CMAKE_FLAGS}
cmake --build ${LIBZMQ}
}

# build zeromq first
Expand All @@ -24,14 +29,14 @@ if [ "${ZMQ_VERSION}" != "" ] ; then install_zeromq ; fi

# build cppzmq
pushd .
ZeroMQ_DIR=libzmq cmake -H. -Bbuild ${ZEROMQ_CMAKE_FLAGS}
cmake --build build
cd build
ZeroMQ_DIR=${LIBZMQ} cmake -H. -B${CPPZMQ} ${ZEROMQ_CMAKE_FLAGS}
cmake --build ${CPPZMQ}
cd ${CPPZMQ}
ctest -V
popd

# build cppzmq demo
ZeroMQ_DIR=libzmq cppzmq_DIR=build cmake -Hdemo -Bdemo/build
ZeroMQ_DIR=${LIBZMQ} cppzmq_DIR=${CPPZMQ} cmake -Hdemo -Bdemo/build
cmake --build demo/build
cd demo/build
ctest
3 changes: 2 additions & 1 deletion demo/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ target_link_libraries(
cppzmq
)

include_directories(${ZeroMQ_INCLUDE_DIR} ${cppzmq_INCLUDE_DIR})
target_include_directories(demo PRIVATE ${cppzmq_INCLUDE_DIR}
${ZeroMQ_INCLUDE_DIR})

add_test(
NAME
Expand Down
5 changes: 3 additions & 2 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,11 @@ add_executable(
target_link_libraries(
unit_tests
gtest_main
libzmq
cppzmq
)

target_include_directories(unit_tests PRIVATE ..)
target_include_directories(unit_tests PRIVATE ${cppzmq_INCLUDE_DIR}
${ZeroMQ_INCLUDE_DIR})

add_test(
NAME
Expand Down

0 comments on commit 3dc20bb

Please sign in to comment.