1
0
mirror of https://github.com/nlohmann/json synced 2024-12-28 19:31:10 +00:00

Merge branch 'feature/travis_clang' into develop

This commit is contained in:
Niels Lohmann 2017-08-15 19:52:47 +02:00
commit 7f4722a75d
No known key found for this signature in database
GPG Key ID: 7F3CEA63AE251B69
2 changed files with 55 additions and 101 deletions

View File

@ -120,6 +120,9 @@ matrix:
compiler: clang
before_install: echo -n | openssl s_client -connect scan.coverity.com:443 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' | sudo tee -a /etc/ssl/certs/ca-certificates.crt
addons:
apt:
sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-precise-3.6']
packages: ['g++-6', 'clang-3.6']
coverity_scan:
project:
name: "nlohmann/json"
@ -129,8 +132,8 @@ matrix:
build_command: "make"
branch_pattern: coverity_scan
env:
- LLVM_VERSION=3.6.0
- SPECIAL=coverity
- COMPILER=clang++-3.6
# OSX / Clang
@ -202,119 +205,71 @@ matrix:
# Linux / Clang
- os: linux
env: LLVM_VERSION=3.6.0
compiler: clang
env: COMPILER=clang++-3.5
addons:
apt:
sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-precise-3.5']
packages: ['g++-6', 'clang-3.5']
- os: linux
env: LLVM_VERSION=3.6.1
compiler: clang
env: COMPILER=clang++-3.6
addons:
apt:
sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-precise-3.6']
packages: ['g++-6', 'clang-3.6']
- os: linux
env: LLVM_VERSION=3.6.2
compiler: clang
# - os: linux
# env: LLVM_VERSION=3.7.0
# compiler: clang
# - os: linux
# env: LLVM_VERSION=3.7.1
# compiler: clang
env: COMPILER=clang++-3.7
addons:
apt:
sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-precise-3.7']
packages: ['g++-6', 'clang-3.7']
- os: linux
env: LLVM_VERSION=3.8.0
compiler: clang
env: COMPILER=clang++-3.8
addons:
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['g++-6', 'clang-3.8']
- os: linux
env: LLVM_VERSION=3.8.1
compiler: clang
env: COMPILER=clang++-3.9
addons:
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['g++-6', 'clang-3.9']
# - os: linux
# addons:
# apt:
# sources: llvm-toolchain-trusty-3.9
# packages: clang-3.9
# env: COMPILER=clang++-3.9
#
# - os: linux
# addons:
# apt:
# sources: llvm-toolchain-trusty-4.0
# packages: clang-4.0
# env: COMPILER=clang++-4.0
#
# - os: linux
# addons:
# apt:
# sources: llvm-toolchain-trusty
# packages: clang-5.0
# env: COMPILER=clang++-5.0
- os: linux
compiler: clang
env: COMPILER=clang++-4.0
addons:
apt:
sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-trusty-4.0']
packages: ['g++-6', 'clang-4.0']
#####################
# installation step #
#####################
# set directories to cache
cache:
directories:
- ${TRAVIS_BUILD_DIR}/deps/llvm-3.6.2
- ${TRAVIS_BUILD_DIR}/deps/llvm-3.6.1
- ${TRAVIS_BUILD_DIR}/deps/llvm-3.6.0
- ${TRAVIS_BUILD_DIR}/deps/llvm-3.7.0
- ${TRAVIS_BUILD_DIR}/deps/llvm-3.7.1
- ${TRAVIS_BUILD_DIR}/deps/llvm-3.8.0
- ${TRAVIS_BUILD_DIR}/deps/llvm-3.8.1
install:
# create deps dir if not existing
- DEPS_DIR="${TRAVIS_BUILD_DIR}/deps"
- mkdir -p ${DEPS_DIR}
# make sure CXX is correctly set
- if [[ "${COMPILER}" != "" ]]; then export CXX=${COMPILER}; fi
# get CMake (only for systems with brew - macOS)
- |
if [[ !(-x $(which cmake)) && (-x $(which brew)) ]]; then
brew update
brew install cmake
cmake --version
fi
# install LLVM/clang when LLVM_VERSION is set
- |
if [[ "${LLVM_VERSION}" != "" ]]; then
LLVM_DIR=${DEPS_DIR}/llvm-${LLVM_VERSION}
if [[ -z "$(ls -A ${LLVM_DIR})" ]]; then
travis_retry wget --quiet https://cmake.org/files/v3.6/cmake-3.6.1.tar.gz
tar xfz cmake-3.6.1.tar.gz
(cd cmake-3.6.1 && ./configure --prefix=${LLVM_DIR}/cmake && make install)
export PATH="${LLVM_DIR}/cmake/bin:${PATH}"
LLVM_URL="http://llvm.org/releases/${LLVM_VERSION}/llvm-${LLVM_VERSION}.src.tar.xz"
LIBCXX_URL="http://llvm.org/releases/${LLVM_VERSION}/libcxx-${LLVM_VERSION}.src.tar.xz"
LIBCXXABI_URL="http://llvm.org/releases/${LLVM_VERSION}/libcxxabi-${LLVM_VERSION}.src.tar.xz"
CLANG_URL="http://llvm.org/releases/${LLVM_VERSION}/clang+llvm-${LLVM_VERSION}-x86_64-linux-gnu-ubuntu-14.04.tar.xz"
mkdir -p ${LLVM_DIR} ${LLVM_DIR}/build ${LLVM_DIR}/projects/libcxx ${LLVM_DIR}/projects/libcxxabi ${LLVM_DIR}/clang
travis_retry wget --quiet -O - ${LLVM_URL} | tar --strip-components=1 -xJ -C ${LLVM_DIR}
travis_retry wget --quiet -O - ${LIBCXX_URL} | tar --strip-components=1 -xJ -C ${LLVM_DIR}/projects/libcxx
travis_retry wget --quiet -O - ${LIBCXXABI_URL} | tar --strip-components=1 -xJ -C ${LLVM_DIR}/projects/libcxxabi
travis_retry wget --quiet -O - ${CLANG_URL} | tar --strip-components=1 -xJ -C ${LLVM_DIR}/clang
(cd ${LLVM_DIR}/build && cmake .. -DCMAKE_INSTALL_PREFIX=${LLVM_DIR}/install -DCMAKE_CXX_COMPILER=clang++)
(cd ${LLVM_DIR}/build/projects/libcxx && make install -j2)
(cd ${LLVM_DIR}/build/projects/libcxxabi && make install -j2)
fi
export CXXFLAGS="-nostdinc++ -isystem ${LLVM_DIR}/install/include/c++/v1"
export LDFLAGS="-L ${LLVM_DIR}/install/lib -l c++ -l c++abi"
export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${LLVM_DIR}/install/lib"
export PATH="${LLVM_DIR}/clang/bin:${PATH}"
fi
- os: linux
compiler: clang
env:
- COMPILER=clang++-4.0
- CXXFLAGS=-std=c++1z
addons:
apt:
sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-trusty-4.0']
packages: ['g++-6', 'clang-4.0']
################
# build script #
################
script:
# make sure CXX is correctly set
- if [[ "${COMPILER}" != "" ]]; then export CXX=${COMPILER}; fi
# show OS/compiler version
- uname -a
- $CXX --version

View File

@ -712,7 +712,7 @@ json j_from_msgpack = json::from_msgpack(v_msgpack);
Though it's 2016 already, the support for C++11 is still a bit sparse. Currently, the following compilers are known to work:
- GCC 4.9 - 7.1 (and possibly later)
- Clang 3.4 - 3.9 (and possibly later)
- Clang 3.4 - 4.0 (and possibly later)
- Microsoft Visual C++ 2015 / Build Tools 14.0.25123.0 (and possibly later)
- Microsoft Visual C++ 2017 / Build Tools 15.1.548.43366 (and possibly later)
@ -741,13 +741,12 @@ The following compilers are currently used in continuous integration at [Travis]
| GCC 5.4.1 | Ubuntu 14.04.5 LTS | g++-5 (Ubuntu 5.4.1-2ubuntu1~14.04) 5.4.1 20160904 |
| GCC 6.3.0 | Ubuntu 14.04.5 LTS | g++-6 (Ubuntu/Linaro 6.3.0-18ubuntu2~14.04) 6.3.0 20170519 |
| GCC 7.1.0 | Ubuntu 14.04.5 LTS | g++-7 (Ubuntu 7.1.0-5ubuntu2~14.04) 7.1.0
| Clang 3.6.0 | Ubuntu 14.04.5 LTS | clang version 3.6.0 (tags/RELEASE_360/final) |
| Clang 3.6.1 | Ubuntu 14.04.5 LTS | clang version 3.6.1 (tags/RELEASE_361/final) |
| Clang 3.6.2 | Ubuntu 14.04.5 LTS | clang version 3.6.2 (tags/RELEASE_362/final) |
| Clang 3.7.0 | Ubuntu 14.04.5 LTS | clang version 3.7.0 (tags/RELEASE_370/final) |
| Clang 3.7.1 | Ubuntu 14.04.5 LTS | clang version 3.7.1 (tags/RELEASE_371/final) |
| Clang 3.8.0 | Ubuntu 14.04.5 LTS | clang version 3.8.0 (tags/RELEASE_380/final) |
| Clang 3.8.1 | Ubuntu 14.04.5 LTS | clang version 3.8.1 (tags/RELEASE_381/final) |
| Clang 3.5.0 | Ubuntu 14.04.5 LTS | clang version 3.5.0-4ubuntu2~trusty2 (tags/RELEASE_350/final) |
| Clang 3.6.2 | Ubuntu 14.04.5 LTS | clang version 3.6.2-svn240577-1~exp1 (branches/release_36) |
| Clang 3.7.1 | Ubuntu 14.04.5 LTS | clang version 3.7.1-svn253571-1~exp1 (branches/release_37) |
| Clang 3.8.0 | Ubuntu 14.04.5 LTS | clang version 3.8.0-2ubuntu3~trusty5 (tags/RELEASE_380/final) |
| Clang 3.9.1 | Ubuntu 14.04.5 LTS | clang version 3.9.1-4ubuntu3~14.04.2 (tags/RELEASE_391/rc2) |
| Clang 4.0.1 | Ubuntu 14.04.5 LTS | clang version 4.0.1-svn305264-1~exp1 (branches/release_40) |
| Clang Xcode 6.4 | Darwin Kernel Version 14.3.0 (OSX 10.10.3) | Apple LLVM version 6.1.0 (clang-602.0.53) (based on LLVM 3.6.0svn) |
| Clang Xcode 7.3 | Darwin Kernel Version 15.0.0 (OSX 10.10.5) | Apple LLVM version 7.3.0 (clang-703.0.29) |
| Clang Xcode 8.0 | Darwin Kernel Version 15.6.0 | Apple LLVM version 8.0.0 (clang-800.0.38) |