Merge pull request #230 from kurdybacha/osx-build

Problem: OSX build not enabled in Travis
This commit is contained in:
Luca Boccassi 2018-05-13 17:29:42 +01:00 committed by GitHub
commit 6fe3d54359
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 66 additions and 65 deletions

View File

@ -2,35 +2,35 @@
language: cpp language: cpp
os:
- linux
#- osx
dist: trusty dist: trusty
cache: ccache cache: ccache
addons:
apt:
sources:
- ubuntu-toolchain-r-test
env:
matrix:
# - BUILD_TYPE=cmake DRAFT=enabled
- BUILD_TYPE=cmake ZMQ_VERSION=4.2.5
- BUILD_TYPE=cmake ZMQ_VERSION=4.2.0
matrix: matrix:
include: include:
# - env: BUILD_TYPE=cmake DO_CLANG_FORMAT_CHECK=1 CLANG_FORMAT=/usr/local/clang-5.0.0/bin/clang-format ##########################################################
# os: linux # Clang on OSX
# addons: # Travis takes longer to start OSX instances,
# apt: # so leaving it first for the overall build to be faster.
# sources: ##########################################################
# - llvm-toolchain-trusty-5.0
# packages: - os: osx
# - clang-5.0 osx_image: xcode9.1
compiler: clang
env: ZMQ_VERSION=4.2.5 DRAFT=1
##########################################################
# GCC on Linux
##########################################################
# GCC default, draft disabled, latest libzmq
- os: linux
env: ZMQ_VERSION=4.2.5
# GCC default, draft disabled, older libzmq
- os: linux
env: ZMQ_VERSION=4.2.4
# GCC 7, draft enabled, latest libzmq
- os: linux - os: linux
addons: addons:
apt: apt:
@ -39,17 +39,26 @@ matrix:
packages: packages:
- g++-7 - g++-7
env: env:
- MATRIX_EVAL="CC=gcc-7 && CXX=g++-7" BUILD_TYPE=cmake ZMQ_VERSION=4.2.5 DRAFT=1 - MATRIX_EVAL="CC=gcc-7 && CXX=g++-7" ZMQ_VERSION=4.2.5 DRAFT=1
# - env: BUILD_TYPE=cmake DO_CLANG_FORMAT_CHECK=1 CLANG_FORMAT=/usr/local/clang-5.0.0/bin/clang-format
# os: linux
# addons:
# apt:
# sources:
# - llvm-toolchain-trusty-5.0
# packages:
# - clang-5.0
sudo: required sudo: false
before_install: before_install:
- pip install --user cpp-coveralls - if [ "$TRAVIS_OS_NAME" = "linux" ]; then pip install --user cpp-coveralls; fi
# Build and check this project according to the BUILD_TYPE # Build and check this project
script: script:
- eval "${MATRIX_EVAL}" - eval "${MATRIX_EVAL}"
- cmake --version
- ./ci_build.sh - ./ci_build.sh
after_success: after_success:
- coveralls --root . -E ".*external.*" -E ".*CMakeFiles.*" -E ".*tests/" -E ".*demo/" -E ".*libzmq/" - if [ "$TRAVIS_OS_NAME" = "linux" ]; then coveralls --root . -E ".*external.*" -E ".*CMakeFiles.*" -E ".*tests/" -E ".*demo/" -E ".*libzmq/"; fi

View File

@ -23,18 +23,18 @@ Supported platforms
- 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. - 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.
- Tested libzmq versions are - Tested libzmq versions are
- 4.2.0 (without DRAFT API) - 4.2.4 (without DRAFT API)
- 4.2.5 (with and without DRAFT API) - 4.2.5 (with and without DRAFT API)
- Platforms with full support (i.e. CI executing build and tests) - Platforms with full support (i.e. CI executing build and tests)
- Ubuntu 14.04 x64 (with gcc 4.8.4) (without DRAFT API only) - Ubuntu 14.04 x64 (with gcc 4.8.4) (without DRAFT API only)
- Ubuntu 14.04 x64 (with gcc 7.3.0) - Ubuntu 14.04 x64 (with gcc 7.3.0)
- Visual Studio 2015 x86 - Visual Studio 2015 x86
- Visual Studio 2017 x86 - Visual Studio 2017 x86
- OSX (with clang xcode9.1) (without DRAFT API)
- Additional platforms that are known to work: - Additional platforms that are known to work:
- 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. - 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.
- Additional platforms that probably work: - Additional platforms that probably work:
- Any platform supported by libzmq that provides a sufficiently recent gcc (4.8.1 or newer) or clang (3.3 or newer) - Any platform supported by libzmq that provides a sufficiently recent gcc (4.8.1 or newer) or clang (3.3 or newer)
- MacOS X
- Visual Studio 2012+ x86/x64 - Visual Studio 2012+ x86/x64
Contribution policy Contribution policy

View File

@ -3,28 +3,27 @@
set -x set -x
set -e set -e
LIBZMQ=${PWD}/libzmq-build
CPPZMQ=${PWD}/cppzmq-build
# Travis machines have 2 cores
JOBS=2
if [ "$DRAFT" = "1" ] ; then if [ "$DRAFT" = "1" ] ; then
# if we enable drafts during the libzmq cmake build, the pkgconfig # if we enable drafts during the libzmq cmake build, the pkgconfig
# data should set ZMQ_BUILD_DRAFT_API in dependent builds, but this # data should set ZMQ_BUILD_DRAFT_API in dependent builds, but this
# does not appear to work (TODO) # does not appear to work (TODO)
export ZEROMQ_CMAKE_FLAGS="-DENABLE_DRAFTS=ON" export ZEROMQ_CMAKE_FLAGS="-DENABLE_DRAFTS=ON"
fi fi
install_zeromq() { install_zeromq() {
pushd . curl -L https://github.com/zeromq/libzmq/archive/v${ZMQ_VERSION}.tar.gz \
>zeromq.tar.gz
mkdir libzmq
cd libzmq
curl -L https://github.com/zeromq/libzmq/archive/v${ZMQ_VERSION}.tar.gz >zeromq.tar.gz
tar -xvzf zeromq.tar.gz tar -xvzf zeromq.tar.gz
cd libzmq-${ZMQ_VERSION} cmake -Hlibzmq-${ZMQ_VERSION} -B${LIBZMQ} -DWITH_PERF_TOOL=OFF \
-DZMQ_BUILD_TESTS=OFF \
mkdir build -DCMAKE_BUILD_TYPE=Release \
cd build ${ZEROMQ_CMAKE_FLAGS}
cmake .. ${ZEROMQ_CMAKE_FLAGS} cmake --build ${LIBZMQ} -- -j${JOBS}
sudo make -j4 install
popd
} }
# build zeromq first # build zeromq first
@ -32,20 +31,15 @@ install_zeromq() {
if [ "${ZMQ_VERSION}" != "" ] ; then install_zeromq ; fi if [ "${ZMQ_VERSION}" != "" ] ; then install_zeromq ; fi
# build cppzmq # build cppzmq
pushd . pushd .
mkdir build ZeroMQ_DIR=${LIBZMQ} cmake -H. -B${CPPZMQ} ${ZEROMQ_CMAKE_FLAGS}
cd build cmake --build ${CPPZMQ} -- -j${JOBS}
cmake .. ${ZEROMQ_CMAKE_FLAGS} cd ${CPPZMQ}
cmake --build . ctest -V -j${JOBS}
sudo make -j4 install
make test ARGS="-V"
popd popd
# build cppzmq demo # build cppzmq demo
cd demo ZeroMQ_DIR=${LIBZMQ} cppzmq_DIR=${CPPZMQ} cmake -Hdemo -Bdemo/build
mkdir build cmake --build demo/build
cd build cd demo/build
cmake .. ctest -V
cmake --build .
ctest

View File

@ -12,7 +12,7 @@ add_executable(
target_link_libraries( target_link_libraries(
demo demo
libzmq cppzmq
) )
add_test( add_test(

View File

@ -33,11 +33,9 @@ add_executable(
target_link_libraries( target_link_libraries(
unit_tests unit_tests
gtest_main gtest_main
libzmq cppzmq
) )
target_include_directories(unit_tests PRIVATE ..)
add_test( add_test(
NAME NAME
unit unit