Skip to content

Commit

Permalink
Merge pull request #13 from ricab/update-ci-compilers
Browse files Browse the repository at this point in the history
Update ci compilers
  • Loading branch information
ricab authored May 16, 2021
2 parents 9ab26f8 + 2c553c0 commit 3ce62eb
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 55 deletions.
77 changes: 22 additions & 55 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,54 +5,16 @@ git:

env:
global:
- MAKEFLAGS="-j2"
- NPROC=$(nproc)
- MAKEFLAGS="-j${NPROC}"
- CATCH_DIR="~/catch"
- CATCH_REMOTE="https://github.com/catchorg/Catch2.git"
- CATCH_VERSION=v2.13.6

matrix:
include:
- os: linux
compiler: gcc # default version
- os: linux
addons:
apt:
sources: ubuntu-toolchain-r-test
packages: g++-4.9
env: MATRIX_EVAL="CC=gcc-4.9 && CXX=g++-4.9"
- os: linux
addons:
apt:
sources: ubuntu-toolchain-r-test
packages: g++-5
env: MATRIX_EVAL="CC=gcc-5 && CXX=g++-5"
- os: linux
addons:
apt:
sources: ubuntu-toolchain-r-test
packages: g++-6
env: MATRIX_EVAL="CC=gcc-6 && CXX=g++-6"
- os: linux
addons:
apt:
sources: ubuntu-toolchain-r-test
packages: g++-7
env: MATRIX_EVAL="CC=gcc-7 && CXX=g++-7"
- os: linux
addons:
apt:
sources: ubuntu-toolchain-r-test
packages: g++-7
env:
- MATRIX_EVAL="CC=gcc-7 && CXX=g++-7"
- CMAKE_COV="-DENABLE_COVERAGE:BOOL=ON" # coverage build
- os: linux
addons:
apt:
sources: llvm-toolchain-trusty-3.6
packages: clang-3.6
env:
- MATRIX_EVAL="CC=clang-3.6 && CXX=clang++-3.6"
compiler: gcc-4.9 # old gcc
- os: linux
addons:
apt:
Expand All @@ -64,27 +26,29 @@ matrix:
- g++-8
env: MATRIX_EVAL="CC=clang-8 && CXX=clang++-8"
- os: linux
dist: focal
addons:
apt:
sources:
- llvm-toolchain-xenial-6.0
- ubuntu-toolchain-r-test
packages:
- clang-6.0
- g++-7
env: MATRIX_EVAL="CC=clang-6.0 && CXX=clang++-6.0"
sources: # for some reason, travis doesn't like the src alias on focal
- sourceline: 'ppa:ubuntu-toolchain-r/test'
packages: g++-11
env: MATRIX_EVAL="CC=gcc-11 && CXX=g++-11"
- os: linux
dist: focal
addons:
apt:
sources: # for some reason, travis doesn't like the src alias on focal
- sourceline: 'ppa:ubuntu-toolchain-r/test'
packages: g++-11
env:
- MATRIX_EVAL="CC=gcc-11 && CXX=g++-11"
- CMAKE_COV="-DENABLE_COVERAGE:BOOL=ON" # coverage build
- os: osx
osx_image: xcode10.3
compiler: clang
- os: osx
osx_image: xcode10.3
compiler: gcc
- os: osx
osx_image: xcode11.6
compiler: clang
- os: osx
osx_image: xcode11.6
compiler: gcc
- os: osx
osx_image: xcode12.5
compiler: clang
Expand All @@ -93,6 +57,7 @@ matrix:
compiler: gcc

before_install:
- echo ${NPROC}
- eval "${MATRIX_EVAL}" # determine overriding compiler, if set

install:
Expand All @@ -112,7 +77,9 @@ script:
- cd build
- cmake -Wdev -Werror=dev -DCMAKE_BUILD_TYPE=Debug ${CMAKE_COV} ..
- cmake --build .
- cmake --build . --target test
- unset MAKEFLAGS # drop MAKEFLAGS, (which would affect compilation tests)
- make test ARGS=-j$((${NPROC} * 2)) # but run twice as many compilation tests
# as the number of available `nproc`

after_success: |-
if [ ! -z "${CMAKE_COV}" ]; then
Expand Down
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ set(CMAKE_REQUIRED_FLAGS "-std=c++1z") # only for this check
CHECK_CXX_SYMBOL_EXISTS(__cpp_noexcept_function_type "" HAS_NOEXCEPT_IN_TYPE)
unset(CMAKE_REQUIRED_FLAGS)

# request C++11 explicitly by default - works around newer compilers otherwise
# omitting `-std=c++11` despite 11 being requested with target_compile_features
set(CMAKE_CXX_STANDARD 11)

# compiler warnings
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
set(clang_warnings "-Weverything -pedantic -Wno-c++98-compat \
Expand Down

0 comments on commit 3ce62eb

Please sign in to comment.