Skip to content

Commit 3dc20bb

Browse files
committed
Problem: libzmq builds with tests
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.
1 parent f35cbe2 commit 3dc20bb

File tree

3 files changed

+16
-9
lines changed

3 files changed

+16
-9
lines changed

ci_build.sh

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,17 @@ if [ "$DRAFT" = "1" ] ; then
1010
export ZEROMQ_CMAKE_FLAGS="-DENABLE_DRAFTS=ON"
1111
fi
1212

13+
LIBZMQ=${PWD}/libzmq-build
14+
CPPZMQ=${PWD}/cppzmq-build
1315
install_zeromq() {
1416
curl -L https://github.com/zeromq/libzmq/archive/v${ZMQ_VERSION}.tar.gz \
1517
>zeromq.tar.gz
1618
tar -xvzf zeromq.tar.gz
17-
cmake -Hlibzmq-${ZMQ_VERSION} -Blibzmq ${ZEROMQ_CMAKE_FLAGS}
18-
cmake --build libzmq
19+
cmake -Hlibzmq-${ZMQ_VERSION} -B${LIBZMQ} -DWITH_PERF_TOOL=OFF \
20+
-DZMQ_BUILD_TESTS=OFF \
21+
-DCMAKE_BUILD_TYPE=Release \
22+
${ZEROMQ_CMAKE_FLAGS}
23+
cmake --build ${LIBZMQ}
1924
}
2025

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

2530
# build cppzmq
2631
pushd .
27-
ZeroMQ_DIR=libzmq cmake -H. -Bbuild ${ZEROMQ_CMAKE_FLAGS}
28-
cmake --build build
29-
cd build
32+
ZeroMQ_DIR=${LIBZMQ} cmake -H. -B${CPPZMQ} ${ZEROMQ_CMAKE_FLAGS}
33+
cmake --build ${CPPZMQ}
34+
cd ${CPPZMQ}
3035
ctest -V
3136
popd
3237

3338
# build cppzmq demo
34-
ZeroMQ_DIR=libzmq cppzmq_DIR=build cmake -Hdemo -Bdemo/build
39+
ZeroMQ_DIR=${LIBZMQ} cppzmq_DIR=${CPPZMQ} cmake -Hdemo -Bdemo/build
3540
cmake --build demo/build
3641
cd demo/build
3742
ctest

demo/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ target_link_libraries(
1515
cppzmq
1616
)
1717

18-
include_directories(${ZeroMQ_INCLUDE_DIR} ${cppzmq_INCLUDE_DIR})
18+
target_include_directories(demo PRIVATE ${cppzmq_INCLUDE_DIR}
19+
${ZeroMQ_INCLUDE_DIR})
1920

2021
add_test(
2122
NAME

tests/CMakeLists.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,11 @@ add_executable(
3333
target_link_libraries(
3434
unit_tests
3535
gtest_main
36-
libzmq
36+
cppzmq
3737
)
3838

39-
target_include_directories(unit_tests PRIVATE ..)
39+
target_include_directories(unit_tests PRIVATE ${cppzmq_INCLUDE_DIR}
40+
${ZeroMQ_INCLUDE_DIR})
4041

4142
add_test(
4243
NAME

0 commit comments

Comments
 (0)