81 lines
2.0 KiB
YAML
81 lines
2.0 KiB
YAML
#########################
|
|
# project configuration #
|
|
#########################
|
|
|
|
# C++ project
|
|
language: cpp
|
|
|
|
dist: trusty
|
|
sudo: required
|
|
group: edge
|
|
|
|
|
|
################
|
|
# build matrix #
|
|
################
|
|
|
|
matrix:
|
|
include:
|
|
|
|
# Linux / GCC
|
|
|
|
- os: linux
|
|
compiler: gcc
|
|
env:
|
|
- COMPILER=g++-9
|
|
- CXXFLAGS=-std=c++2a
|
|
addons:
|
|
apt:
|
|
sources: ['ubuntu-toolchain-r-test']
|
|
packages: ['g++-9', 'ninja-build']
|
|
|
|
# Linux / Clang
|
|
|
|
- os: linux
|
|
compiler: clang
|
|
env:
|
|
- COMPILER=clang++-7
|
|
- CXXFLAGS=-std=c++1z
|
|
addons:
|
|
apt:
|
|
sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-trusty-7']
|
|
packages: ['g++-6', 'clang-7', 'ninja-build']
|
|
|
|
################
|
|
# build script #
|
|
################
|
|
|
|
script:
|
|
# get CMake and Ninja (only for systems with brew - macOS)
|
|
- |
|
|
if [[ (-x $(which brew)) ]]; then
|
|
brew update
|
|
brew install cmake ninja
|
|
brew upgrade cmake
|
|
cmake --version
|
|
fi
|
|
|
|
# make sure CXX is correctly set
|
|
- if [[ "${COMPILER}" != "" ]]; then export CXX=${COMPILER}; fi
|
|
# by default, use the single-header version
|
|
- if [[ "${MULTIPLE_HEADERS}" == "" ]]; then export MULTIPLE_HEADERS=OFF; fi
|
|
# by default, use implicit conversions
|
|
- if [[ "${IMPLICIT_CONVERSIONS}" == "" ]]; then export IMPLICIT_CONVERSIONS=ON; fi
|
|
|
|
# force verbose build
|
|
- CMAKE_OPTIONS+=" -DCMAKE_VERBOSE_MAKEFILE=ON"
|
|
|
|
# compile and execute unit tests
|
|
- mkdir -p build && cd build
|
|
- cmake .. ${CMAKE_OPTIONS} -DJSON_MultipleHeaders=${MULTIPLE_HEADERS} -DJSON_ImplicitConversions=${IMPLICIT_CONVERSIONS} -DJSON_BuildTests=On -GNinja && cmake --build . --config Release --target test-conversions
|
|
- ctest -C Release --timeout 2700 -V -R test-conversions -j
|
|
- cd ..
|
|
|
|
# check if homebrew works (only checks develop branch)
|
|
- if [ `which brew` ]; then
|
|
brew update ;
|
|
brew tap nlohmann/json ;
|
|
brew install nlohmann_json --HEAD ;
|
|
brew test nlohmann_json ;
|
|
fi
|