File tree Expand file tree Collapse file tree 5 files changed +32
-3
lines changed Expand file tree Collapse file tree 5 files changed +32
-3
lines changed Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ matrix:
39
39
packages :
40
40
- g++-7
41
41
env :
42
- - MATRIX_EVAL="CC=gcc-7 && CXX=g++-7" BUILD_TYPE=cmake ZMQ_VERSION=4.2.5
42
+ - MATRIX_EVAL="CC=gcc-7 && CXX=g++-7" BUILD_TYPE=cmake ZMQ_VERSION=4.2.5 DRAFT=1
43
43
44
44
sudo : required
45
45
Original file line number Diff line number Diff line change @@ -19,6 +19,18 @@ if (ZeroMQ_FOUND AND (NOT TARGET libzmq OR NOT TARGET libzmq-static))
19
19
message (FATAL_ERROR "ZeroMQ version not supported!" )
20
20
endif ()
21
21
22
+ if (EXISTS "${SOURCE_DIR} /.git" )
23
+ OPTION (ENABLE_DRAFTS "Build and install draft classes and methods" ON )
24
+ else ()
25
+ OPTION (ENABLE_DRAFTS "Build and install draft classes and methods" OFF )
26
+ endif ()
27
+ IF (ENABLE_DRAFTS )
28
+ ADD_DEFINITIONS (-DZMQ_BUILD_DRAFT_API )
29
+ set (pkg_config_defines "-DZMQ_BUILD_DRAFT_API=1" )
30
+ ELSE (ENABLE_DRAFTS )
31
+ set (pkg_config_defines "" )
32
+ ENDIF (ENABLE_DRAFTS )
33
+
22
34
message (STATUS "cppzmq v${CPPZMQ_VERSION} " )
23
35
24
36
set (CPPZMQ_HEADERS
Original file line number Diff line number Diff line change 3
3
set -x
4
4
set -e
5
5
6
+ if [ " $DRAFT " = " 1" ] ; then
7
+ # if we enable drafts during the libzmq cmake build, the pkgconfig
8
+ # data should set ZMQ_BUILD_DRAFT_API in dependent builds, but this
9
+ # does not appear to work (TODO)
10
+ export ZEROMQ_CMAKE_FLAGS=" -DENABLE_DRAFTS=ON"
11
+ fi
12
+
6
13
install_zeromq () {
7
14
pushd .
8
15
@@ -14,7 +21,7 @@ install_zeromq() {
14
21
15
22
mkdir build
16
23
cd build
17
- cmake ..
24
+ cmake .. ${ZEROMQ_CMAKE_FLAGS}
18
25
sudo make -j4 install
19
26
20
27
popd
@@ -29,7 +36,7 @@ if [ "${ZMQ_VERSION}" != "" ] ; then install_zeromq ; fi
29
36
pushd .
30
37
mkdir build
31
38
cd build
32
- cmake ..
39
+ cmake .. ${ZEROMQ_CMAKE_FLAGS}
33
40
cmake --build .
34
41
sudo make -j4 install
35
42
make test ARGS=" -V"
Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ add_executable(
24
24
unit_tests
25
25
context.cpp
26
26
socket.cpp
27
+ poller.cpp
27
28
)
28
29
29
30
target_link_libraries (
Original file line number Diff line number Diff line change
1
+ #include < gtest/gtest.h>
2
+ #include < zmq.hpp>
3
+
4
+ #if defined(ZMQ_CPP11) && defined(ZMQ_BUILD_DRAFT_API)
5
+ TEST (poller, create_destroy)
6
+ {
7
+ zmq::poller_t context;
8
+ }
9
+ #endif
You can’t perform that action at this time.
0 commit comments