From 12693a011b3b10039e9a1699517dc9d885bef1a5 Mon Sep 17 00:00:00 2001 From: Dmitri Tikhonov Date: Tue, 29 Jan 2019 01:55:01 -0500 Subject: [PATCH] Add MacOS to Travis CI; simplify .travis.yml --- .travis.yml | 71 +++++++++++++++++++++++--------------------------- CMakeLists.txt | 14 +++++----- 2 files changed, 41 insertions(+), 44 deletions(-) diff --git a/.travis.yml b/.travis.yml index ccd623b..da3aee2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,41 +1,36 @@ -language: cpp -compiler: - - clang - - gcc +language: c +matrix: + include: + - name: Linux (gcc) + os: linux + compiler: gcc + addons: + apt: + packages: + - libevent-dev + - name: Linux (clang) + os: linux + compiler: clang + addons: + apt: + packages: + - libevent-dev + - name: macOS + os: osx sudo: false -addons: - apt: - sources: - - ubuntu-toolchain-r-test - - llvm-toolchain-precise-3.8 - - george-edison55-precise-backports - packages: - - g++-5 - - clang-3.8 - - libevent-dev - - libssl-dev - - cmake - - cmake-data -before_install: - - $CC --version - - if [ "$CXX" = "g++" ]; then export CXX="g++-5" CC="gcc-5"; else export CXX="clang++-3.8" CC="clang-3.8"; fi - - $CC --version - - cmake --version before_script: - - git clone https://boringssl.googlesource.com/boringssl - - cd boringssl - - git checkout chromium-stable - - cmake . - - make -j$(nproc) - - BORINGSSL_SOURCE=$PWD - - mkdir -p $HOME/boringssl-libs - - cd $HOME/boringssl-libs - - ln -s $BORINGSSL_SOURCE/ssl/libssl.a - - ln -s $BORINGSSL_SOURCE/crypto/libcrypto.a - - cd $TRAVIS_BUILD_DIR - - echo $BORINGSSL_SOURCE - - cmake -DBORINGSSL_INCLUDE=$BORINGSSL_SOURCE/include -DBORINGSSL_LIB=$HOME/boringssl-libs . + - git clone https://boringssl.googlesource.com/boringssl + - cd boringssl + # This is so that both GQUIC and IETF branches build. Just picking + # a known good revision: + - git checkout 32e59d2d3264e4e104b355ef73663b8b79ac4093 + - cmake . + - make + - ln -s ssl/libssl.a + - ln -s crypto/libcrypto.a + - cd - + - cmake -DBORINGSSL_INCLUDE=$PWD/boringssl/include -DBORINGSSL_LIB=$PWD/boringssl . script: - # Now build lsquic-client - - make - - make test + # Now build lsquic-client + - make + - make test diff --git a/CMakeLists.txt b/CMakeLists.txt index 384f20b..a66c011 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,12 +17,14 @@ ENDIF() ENDIF() -# If using older glibc, need to link with -lrt. See clock_getres(2). -EXECUTE_PROCESS( - COMMAND ${PROJECT_SOURCE_DIR}/print-glibc-version.sh ${CMAKE_C_COMPILER} - OUTPUT_VARIABLE GLIBC_VERSION) -IF(NOT GLIBC_VERSION EQUAL "" AND GLIBC_VERSION VERSION_LESS 2.17) - SET(LIBS ${LIBS} rt) +IF (CMAKE_SYSTEM_NAME STREQUAL "Linux") + # If using older glibc, need to link with -lrt. See clock_getres(2). + EXECUTE_PROCESS( + COMMAND ${PROJECT_SOURCE_DIR}/print-glibc-version.sh ${CMAKE_C_COMPILER} + OUTPUT_VARIABLE GLIBC_VERSION) + IF(NOT GLIBC_VERSION EQUAL "" AND GLIBC_VERSION VERSION_LESS 2.17) + SET(LIBS ${LIBS} rt) + ENDIF() ENDIF() IF("${CMAKE_BUILD_TYPE}" STREQUAL "")