Skip to content

Commit 6fe3d54

Browse files
authored
Merge pull request #230 from kurdybacha/osx-build
Problem: OSX build not enabled in Travis
2 parents f81accd + 4b6c4b6 commit 6fe3d54

File tree

5 files changed

+66
-65
lines changed

5 files changed

+66
-65
lines changed

.travis.yml

Lines changed: 40 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -2,35 +2,35 @@
22

33
language: cpp
44

5-
os:
6-
- linux
7-
#- osx
8-
95
dist: trusty
10-
116
cache: ccache
127

13-
addons:
14-
apt:
15-
sources:
16-
- ubuntu-toolchain-r-test
17-
18-
env:
19-
matrix:
20-
# - BUILD_TYPE=cmake DRAFT=enabled
21-
- BUILD_TYPE=cmake ZMQ_VERSION=4.2.5
22-
- BUILD_TYPE=cmake ZMQ_VERSION=4.2.0
23-
248
matrix:
259
include:
26-
# - env: BUILD_TYPE=cmake DO_CLANG_FORMAT_CHECK=1 CLANG_FORMAT=/usr/local/clang-5.0.0/bin/clang-format
27-
# os: linux
28-
# addons:
29-
# apt:
30-
# sources:
31-
# - llvm-toolchain-trusty-5.0
32-
# packages:
33-
# - clang-5.0
10+
##########################################################
11+
# Clang on OSX
12+
# Travis takes longer to start OSX instances,
13+
# so leaving it first for the overall build to be faster.
14+
##########################################################
15+
16+
- os: osx
17+
osx_image: xcode9.1
18+
compiler: clang
19+
env: ZMQ_VERSION=4.2.5 DRAFT=1
20+
21+
##########################################################
22+
# GCC on Linux
23+
##########################################################
24+
25+
# GCC default, draft disabled, latest libzmq
26+
- os: linux
27+
env: ZMQ_VERSION=4.2.5
28+
29+
# GCC default, draft disabled, older libzmq
30+
- os: linux
31+
env: ZMQ_VERSION=4.2.4
32+
33+
# GCC 7, draft enabled, latest libzmq
3434
- os: linux
3535
addons:
3636
apt:
@@ -39,17 +39,26 @@ matrix:
3939
packages:
4040
- g++-7
4141
env:
42-
- MATRIX_EVAL="CC=gcc-7 && CXX=g++-7" BUILD_TYPE=cmake ZMQ_VERSION=4.2.5 DRAFT=1
42+
- MATRIX_EVAL="CC=gcc-7 && CXX=g++-7" ZMQ_VERSION=4.2.5 DRAFT=1
43+
# - env: BUILD_TYPE=cmake DO_CLANG_FORMAT_CHECK=1 CLANG_FORMAT=/usr/local/clang-5.0.0/bin/clang-format
44+
# os: linux
45+
# addons:
46+
# apt:
47+
# sources:
48+
# - llvm-toolchain-trusty-5.0
49+
# packages:
50+
# - clang-5.0
4351

44-
sudo: required
52+
sudo: false
4553

4654
before_install:
47-
- pip install --user cpp-coveralls
48-
49-
# Build and check this project according to the BUILD_TYPE
50-
script:
55+
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then pip install --user cpp-coveralls; fi
56+
57+
# Build and check this project
58+
script:
5159
- eval "${MATRIX_EVAL}"
60+
- cmake --version
5261
- ./ci_build.sh
5362

5463
after_success:
55-
- coveralls --root . -E ".*external.*" -E ".*CMakeFiles.*" -E ".*tests/" -E ".*demo/" -E ".*libzmq/"
64+
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then coveralls --root . -E ".*external.*" -E ".*CMakeFiles.*" -E ".*tests/" -E ".*demo/" -E ".*libzmq/"; fi

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,18 @@ Supported platforms
2323

2424
- Only a subset of the platforms that are supported by libzmq itself are supported. Some features already require a compiler supporting C++11. In the future, probably all features will require C++11. To build and run the tests, cmake and googletest are required.
2525
- Tested libzmq versions are
26-
- 4.2.0 (without DRAFT API)
26+
- 4.2.4 (without DRAFT API)
2727
- 4.2.5 (with and without DRAFT API)
2828
- Platforms with full support (i.e. CI executing build and tests)
2929
- Ubuntu 14.04 x64 (with gcc 4.8.4) (without DRAFT API only)
3030
- Ubuntu 14.04 x64 (with gcc 7.3.0)
3131
- Visual Studio 2015 x86
3232
- Visual Studio 2017 x86
33+
- OSX (with clang xcode9.1) (without DRAFT API)
3334
- Additional platforms that are known to work:
3435
- We have no current reports on additional platforms that are known to work yet. Please add your platform here. If CI can be provided for them with a cloud-based CI service working with GitHub, you are invited to add CI, and make it possible to be included in the list above.
3536
- Additional platforms that probably work:
3637
- Any platform supported by libzmq that provides a sufficiently recent gcc (4.8.1 or newer) or clang (3.3 or newer)
37-
- MacOS X
3838
- Visual Studio 2012+ x86/x64
3939

4040
Contribution policy

ci_build.sh

Lines changed: 22 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -3,49 +3,43 @@
33
set -x
44
set -e
55

6+
LIBZMQ=${PWD}/libzmq-build
7+
CPPZMQ=${PWD}/cppzmq-build
8+
# Travis machines have 2 cores
9+
JOBS=2
10+
611
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
12+
# if we enable drafts during the libzmq cmake build, the pkgconfig
13+
# data should set ZMQ_BUILD_DRAFT_API in dependent builds, but this
914
# does not appear to work (TODO)
1015
export ZEROMQ_CMAKE_FLAGS="-DENABLE_DRAFTS=ON"
1116
fi
1217

1318
install_zeromq() {
14-
pushd .
15-
16-
mkdir libzmq
17-
cd libzmq
18-
curl -L https://github.com/zeromq/libzmq/archive/v${ZMQ_VERSION}.tar.gz >zeromq.tar.gz
19+
curl -L https://github.com/zeromq/libzmq/archive/v${ZMQ_VERSION}.tar.gz \
20+
>zeromq.tar.gz
1921
tar -xvzf zeromq.tar.gz
20-
cd libzmq-${ZMQ_VERSION}
21-
22-
mkdir build
23-
cd build
24-
cmake .. ${ZEROMQ_CMAKE_FLAGS}
25-
sudo make -j4 install
26-
27-
popd
22+
cmake -Hlibzmq-${ZMQ_VERSION} -B${LIBZMQ} -DWITH_PERF_TOOL=OFF \
23+
-DZMQ_BUILD_TESTS=OFF \
24+
-DCMAKE_BUILD_TYPE=Release \
25+
${ZEROMQ_CMAKE_FLAGS}
26+
cmake --build ${LIBZMQ} -- -j${JOBS}
2827
}
2928

3029
# build zeromq first
3130

3231
if [ "${ZMQ_VERSION}" != "" ] ; then install_zeromq ; fi
3332

3433
# build cppzmq
35-
3634
pushd .
37-
mkdir build
38-
cd build
39-
cmake .. ${ZEROMQ_CMAKE_FLAGS}
40-
cmake --build .
41-
sudo make -j4 install
42-
make test ARGS="-V"
35+
ZeroMQ_DIR=${LIBZMQ} cmake -H. -B${CPPZMQ} ${ZEROMQ_CMAKE_FLAGS}
36+
cmake --build ${CPPZMQ} -- -j${JOBS}
37+
cd ${CPPZMQ}
38+
ctest -V -j${JOBS}
4339
popd
4440

4541
# build cppzmq demo
46-
cd demo
47-
mkdir build
48-
cd build
49-
cmake ..
50-
cmake --build .
51-
ctest
42+
ZeroMQ_DIR=${LIBZMQ} cppzmq_DIR=${CPPZMQ} cmake -Hdemo -Bdemo/build
43+
cmake --build demo/build
44+
cd demo/build
45+
ctest -V

demo/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ add_executable(
1212

1313
target_link_libraries(
1414
demo
15-
libzmq
15+
cppzmq
1616
)
1717

1818
add_test(

tests/CMakeLists.txt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,9 @@ 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 ..)
40-
4139
add_test(
4240
NAME
4341
unit

0 commit comments

Comments
 (0)