2017-06-27 18:11:16 +00:00
|
|
|
# Build matrix / environment variables are explained on:
|
|
|
|
# http://about.travis-ci.org/docs/user/build-configuration/
|
|
|
|
# This file can be validated on: http://lint.travis-ci.org/
|
|
|
|
|
|
|
|
language: cpp
|
2019-04-29 22:10:15 +00:00
|
|
|
dist: xenial
|
|
|
|
osx_image: xcode10.2
|
2017-06-27 18:11:16 +00:00
|
|
|
|
|
|
|
compiler:
|
2019-04-29 22:10:15 +00:00
|
|
|
- gcc
|
|
|
|
- clang
|
2017-06-27 18:11:16 +00:00
|
|
|
os:
|
2019-04-29 22:10:15 +00:00
|
|
|
- linux
|
|
|
|
- osx
|
2017-06-27 18:11:16 +00:00
|
|
|
|
|
|
|
env:
|
2019-04-29 22:10:15 +00:00
|
|
|
- BUILD_TYPE=Debug CPU_LEVEL=AVX
|
|
|
|
- BUILD_TYPE=Debug CPU_LEVEL=AVX2
|
|
|
|
- BUILD_TYPE=RelWithDebInfo CPU_LEVEL=AVX
|
|
|
|
- BUILD_TYPE=RelWithDebInfo CPU_LEVEL=AVX2
|
2017-06-27 18:11:16 +00:00
|
|
|
|
2017-04-26 11:24:58 +00:00
|
|
|
matrix:
|
2018-08-16 17:17:06 +00:00
|
|
|
exclude:
|
2019-04-29 22:10:15 +00:00
|
|
|
# Travis OSX servers seem to run on pre-Haswell CPUs. Attempting to use AVX2
|
|
|
|
# results in crashes.
|
|
|
|
- env: BUILD_TYPE=Debug CPU_LEVEL=AVX2
|
|
|
|
os: osx
|
|
|
|
- env: BUILD_TYPE=RelWithDebInfo CPU_LEVEL=AVX2
|
|
|
|
os: osx
|
2017-06-27 18:11:16 +00:00
|
|
|
|
|
|
|
addons:
|
|
|
|
apt:
|
|
|
|
sources:
|
2019-04-29 22:10:15 +00:00
|
|
|
- llvm-toolchain-xenial-8
|
2017-06-27 18:11:16 +00:00
|
|
|
- ubuntu-toolchain-r-test
|
|
|
|
packages:
|
2019-04-29 22:10:15 +00:00
|
|
|
- clang-8
|
2017-06-27 18:11:16 +00:00
|
|
|
- cmake
|
2019-05-25 21:34:40 +00:00
|
|
|
- gcc-9
|
|
|
|
- g++-9
|
2019-01-03 01:51:12 +00:00
|
|
|
- ninja-build
|
|
|
|
homebrew:
|
|
|
|
packages:
|
|
|
|
- cmake
|
2019-05-25 21:34:40 +00:00
|
|
|
- gcc@9
|
2019-04-29 22:10:15 +00:00
|
|
|
- llvm@8
|
2019-01-03 01:51:12 +00:00
|
|
|
- ninja
|
2019-04-29 22:10:15 +00:00
|
|
|
update: true
|
2019-01-03 01:51:12 +00:00
|
|
|
|
|
|
|
install:
|
2019-04-29 22:10:15 +00:00
|
|
|
# The following Homebrew packages aren't linked by default, and need to be
|
|
|
|
# prepended to the path explicitly.
|
|
|
|
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then
|
|
|
|
export PATH="$(brew --prefix llvm)/bin:$PATH";
|
|
|
|
fi
|
|
|
|
# /usr/bin/gcc points to an older compiler on both Linux and macOS.
|
2019-05-25 21:34:40 +00:00
|
|
|
- if [ "$CXX" = "g++" ]; then export CXX="g++-9" CC="gcc-9"; fi
|
2019-04-29 22:10:15 +00:00
|
|
|
# /usr/bin/clang points to an older compiler on both Linux and macOS.
|
|
|
|
#
|
|
|
|
# Homebrew's llvm package doesn't ship a versioned clang++ binary, so the values
|
|
|
|
# below don't work on macOS. Fortunately, the path change above makes the
|
|
|
|
# default values (clang and clang++) resolve to the correct compiler on macOS.
|
|
|
|
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then
|
|
|
|
if [ "$CXX" = "clang++" ]; then export CXX="clang++-8" CC="clang-8"; fi;
|
|
|
|
fi
|
2017-06-27 18:11:16 +00:00
|
|
|
- echo ${CC}
|
|
|
|
- echo ${CXX}
|
|
|
|
- ${CXX} --version
|
2017-07-28 16:55:21 +00:00
|
|
|
- cmake --version
|
2017-06-27 18:11:16 +00:00
|
|
|
|
2017-07-27 23:34:19 +00:00
|
|
|
before_script:
|
|
|
|
- mkdir -p build && cd build
|
2019-07-27 08:57:49 +00:00
|
|
|
- if [ "$CXX" = "clang++-8"; then
|
|
|
|
# Build UBSan binary
|
|
|
|
export CXXFLAGS="-fsanitize=undefined -fsanitize-coverage=bb,trace-pc-guard";
|
|
|
|
cmake .. -G Ninja -DCMAKE_BUILD_TYPE=$BUILD_TYPE
|
2019-01-08 14:06:34 +00:00
|
|
|
-DSNAPPY_REQUIRE_${CPU_LEVEL}=ON
|
2019-07-27 08:57:49 +00:00
|
|
|
-DSNAPPY_BUILD_FUZZERS=ON;
|
|
|
|
else
|
|
|
|
cmake .. -G Ninja -DCMAKE_BUILD_TYPE=$BUILD_TYPE
|
|
|
|
-DSNAPPY_REQUIRE_${CPU_LEVEL}=ON;
|
|
|
|
fi
|
2017-07-27 23:34:19 +00:00
|
|
|
- cmake --build .
|
|
|
|
- cd ..
|
|
|
|
|
2017-06-27 18:11:16 +00:00
|
|
|
script:
|
2018-03-09 15:42:50 +00:00
|
|
|
- build/snappy_unittest
|
2019-06-28 18:49:35 +00:00
|
|
|
- build/snappy_compress_uncompress_fuzzer -runs=1000 -close_fd_mask=3
|
|
|
|
- build/snappy_uncompress_fuzzer -runs=1000 -close_fd_mask=3
|