.travis.yml raw

   1  # Build matrix / environment variables are explained on:
   2  # http://about.travis-ci.org/docs/user/build-configuration/
   3  # This file can be validated on: http://lint.travis-ci.org/
   4  
   5  language: cpp
   6  dist: bionic
   7  osx_image: xcode12.5
   8  
   9  compiler:
  10  - gcc
  11  - clang
  12  os:
  13  - linux
  14  - osx
  15  
  16  env:
  17  - GLOG=1 SHARED_LIB=0 BUILD_TYPE=Debug
  18  - GLOG=1 SHARED_LIB=0 BUILD_TYPE=RelWithDebInfo
  19  - GLOG=0 SHARED_LIB=0 BUILD_TYPE=Debug
  20  - GLOG=0 SHARED_LIB=0 BUILD_TYPE=RelWithDebInfo
  21  - GLOG=0 SHARED_LIB=1 BUILD_TYPE=Debug
  22  - GLOG=0 SHARED_LIB=1 BUILD_TYPE=RelWithDebInfo
  23  
  24  addons:
  25    apt:
  26      sources:
  27      - sourceline: 'deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-12 main'
  28        key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key'
  29      - sourceline: 'ppa:ubuntu-toolchain-r/test'
  30      packages:
  31      - clang-12
  32      - cmake
  33      - gcc-11
  34      - g++-11
  35      - ninja-build
  36    homebrew:
  37      packages:
  38      - cmake
  39      - gcc@11
  40      - llvm@12
  41      - ninja
  42      update: true
  43  
  44  install:
  45  # The following Homebrew packages aren't linked by default, and need to be
  46  # prepended to the path explicitly.
  47  - if [ "$TRAVIS_OS_NAME" = "osx" ]; then
  48      export PATH="$(brew --prefix llvm)/bin:$PATH";
  49    fi
  50  # /usr/bin/gcc points to an older compiler on both Linux and macOS.
  51  - if [ "$CXX" = "g++" ]; then export CXX="g++-11" CC="gcc-11"; fi
  52  # /usr/bin/clang points to an older compiler on both Linux and macOS.
  53  #
  54  # Homebrew's llvm package doesn't ship a versioned clang++ binary, so the values
  55  # below don't work on macOS. Fortunately, the path change above makes the
  56  # default values (clang and clang++) resolve to the correct compiler on macOS.
  57  - if [ "$TRAVIS_OS_NAME" = "linux" ]; then
  58      if [ "$CXX" = "clang++" ]; then export CXX="clang++-12" CC="clang-12"; fi;
  59    fi
  60  - echo ${CC}
  61  - echo ${CXX}
  62  - ${CXX} --version
  63  - cmake --version
  64  
  65  before_script:
  66  - mkdir -p build && cd build
  67  - cmake .. -G Ninja -DCRC32C_USE_GLOG=$GLOG -DCMAKE_BUILD_TYPE=$BUILD_TYPE
  68             -DBUILD_SHARED_LIBS=$SHARED_LIB -DCMAKE_INSTALL_PREFIX=$HOME/.local
  69  - cmake --build .
  70  - cd ..
  71  
  72  script:
  73  - build/crc32c_tests
  74  - build/crc32c_capi_tests
  75  - build/crc32c_bench
  76  - cd build && cmake --build . --target install
  77