forked from graeme-hill/crossguid
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- build on more compilers • GCC 7, 8, and 9 on Linux • clang 6, 7, and 8 on Linux • xcode 9.4 and 10.2 on macOS - update to xenial - remove all workarounds/special cases - don't pull in/update all of homebrew on macOS builds (this was quite slow)
- Loading branch information
Showing
1 changed file
with
96 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,76 +1,110 @@ | ||
dist: xenial | ||
sudo: required | ||
language: cpp | ||
dist: trusty | ||
os: linux | ||
|
||
matrix: | ||
include: | ||
|
||
- os: linux | ||
addons: &gcc5 | ||
apt: | ||
packages: | ||
- g++-5 | ||
sources: | ||
- ubuntu-toolchain-r-test | ||
|
||
- os: linux | ||
addons: &gcc6 | ||
apt: | ||
packages: | ||
- g++-6 | ||
sources: | ||
- ubuntu-toolchain-r-test | ||
##### | ||
## Clang on macOS | ||
##### | ||
|
||
# xcode 9.4 | ||
- os: osx | ||
osx_image: xcode9.2 | ||
compiler: clang | ||
osx_image: xcode9.4 | ||
|
||
# xcode 10.2 | ||
- os: osx | ||
osx_image: xcode8.3 | ||
compiler: clang | ||
osx_image: xcode10.2 | ||
|
||
##### | ||
## Clang on Linux | ||
##### | ||
|
||
# clang 6 | ||
- addons: | ||
apt: | ||
sources: | ||
- ubuntu-toolchain-r-test | ||
- llvm-toolchain-xenial-6 | ||
packages: | ||
- clang-6.0 | ||
- uuid-dev | ||
env: | ||
- SET_COMPILERS="CC=clang-6.0 && CXX=clang++-6.0" | ||
|
||
# clang 7 | ||
- addons: | ||
apt: | ||
sources: | ||
- ubuntu-toolchain-r-test | ||
- llvm-toolchain-xenial-7 | ||
packages: | ||
- clang-7 | ||
- uuid-dev | ||
env: | ||
- SET_COMPILERS="CC=clang-7 && CXX=clang++-7" | ||
|
||
# clang 8 | ||
- addons: | ||
apt: | ||
sources: | ||
- ubuntu-toolchain-r-test | ||
- llvm-toolchain-xenial-8 | ||
packages: | ||
- clang-8 | ||
- uuid-dev | ||
env: | ||
- SET_COMPILERS="CC=clang-8 && CXX=clang++-8" | ||
|
||
##### | ||
## GCC on Linux | ||
##### | ||
|
||
# gcc 7 | ||
- addons: | ||
apt: | ||
sources: | ||
- ubuntu-toolchain-r-test | ||
packages: | ||
- g++-7 | ||
- uuid-dev | ||
env: | ||
- SET_COMPILERS="CC=gcc-7 && CXX=g++-7" | ||
|
||
# gcc 8 | ||
- addons: | ||
apt: | ||
sources: | ||
- ubuntu-toolchain-r-test | ||
packages: | ||
- g++-8 | ||
- uuid-dev | ||
env: | ||
- SET_COMPILERS="CC=gcc-8 && CXX=g++-8" | ||
|
||
# gcc 9 | ||
- addons: | ||
apt: | ||
sources: | ||
- ubuntu-toolchain-r-test | ||
packages: | ||
- g++-9 | ||
- uuid-dev | ||
env: | ||
- SET_COMPILERS="CC=gcc-9 && CXX=g++-9" | ||
|
||
before_install: | ||
# Workaround for Travis CI macOS bug (https://github.com/travis-ci/travis-ci/issues/6307) | ||
# See https://github.com/searchivarius/nmslib/pull/259 | ||
- | | ||
if [ "${TRAVIS_OS_NAME}" == "osx" ]; then | ||
command curl -sSL https://rvm.io/mpapis.asc | gpg --import -; | ||
rvm get head || true | ||
fi | ||
script: | ||
- export CHECKOUT_PATH=`pwd`; | ||
- echo "ROOT_PATH= $ROOT_PATH" | ||
- echo "CHECKOUT_PATH= $CHECKOUT_PATH" | ||
# We have to do this here instead of just setting the env vars in the matrix | ||
# because the compilers need to override the default setup | ||
- eval "${SET_COMPILERS}" | ||
|
||
####################################################################################### | ||
# Install a recent CMake (unless already installed on OS X) | ||
####################################################################################### | ||
- | | ||
if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then | ||
CMAKE_URL="http://www.cmake.org/files/v3.10/cmake-3.10.2-Linux-x86_64.tar.gz" | ||
mkdir cmake && travis_retry wget --no-check-certificate --quiet -O - ${CMAKE_URL} | tar --strip-components=1 -xz -C cmake | ||
export PATH=${DEPS_DIR}/cmake/bin:${PATH} | ||
else | ||
brew upgrade cmake || echo "suppress failures in order to ignore warnings" | ||
brew link --overwrite cmake | ||
fi | ||
- cmake --version | ||
before_script: | ||
- cd "${TRAVIS_BUILD_DIR}" | ||
- mkdir build && cd build | ||
- cmake .. -DCMAKE_BUILD_TYPE="Debug" | ||
|
||
- | | ||
if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then | ||
sudo apt-get install uuid-dev | ||
fi | ||
####################################################################################### | ||
# Build the library | ||
####################################################################################### | ||
- | | ||
cd "${CHECKOUT_PATH}" | ||
mkdir build | ||
cd build | ||
cmake .. -DCMAKE_BUILD_TYPE="Debug" | ||
sudo make install | ||
####################################################################################### | ||
# Run the tests | ||
####################################################################################### | ||
script: | ||
- cmake --build . -- -j${JOBS} && sudo make install | ||
- ./crossguid-test |