-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
230 changed files
with
6,823 additions
and
1,942 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
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
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 |
---|---|---|
|
@@ -9,3 +9,6 @@ working | |
|
||
html | ||
me.nlohmann.json.docset | ||
|
||
android | ||
doc/xml |
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 |
---|---|---|
|
@@ -3,6 +3,12 @@ language: cpp | |
dist: trusty | ||
sudo: required | ||
|
||
env: | ||
global: | ||
# The next declaration is the encrypted COVERITY_SCAN_TOKEN, created | ||
# via the "travis encrypt" command using the project repo's public key | ||
- secure: "m89SSgE+ASLO38rSKx7MTXK3n5NkP9bIx95jwY71YEiuFzib30PDJ/DifKnXxBjvy/AkCGztErQRk/8ZCvq+4HXozU2knEGnL/RUitvlwbhzfh2D4lmS3BvWBGS3N3NewoPBrRmdcvnT0xjOGXxtZaJ3P74TkB9GBnlz/HmKORA=" | ||
|
||
# from http://stackoverflow.com/a/32127147/266378 | ||
matrix: | ||
include: | ||
|
@@ -19,49 +25,146 @@ matrix: | |
- touch src/json.hpp | ||
- make json_unit CXXFLAGS="-fprofile-arcs -ftest-coverage -std=c++11 -lstdc++" CXX=$COMPILER | ||
- ./json_unit "*" | ||
- coveralls --exclude test/catch.hpp --exclude test/unit.cpp --include src/json.hpp --gcov-options '\-lp' --gcov 'gcov-4.9' | ||
- coveralls --exclude test/src/catch.hpp --exclude test/src/unit.cpp --include src/json.hpp --gcov-options '\-lp' --gcov 'gcov-4.9' | ||
- bash <(curl -s https://codecov.io/bash) | ||
env: COMPILER=g++-4.9 | ||
|
||
- os: linux | ||
compiler: gcc | ||
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'] | ||
packages: ['g++-5', 'valgrind'] | ||
coverity_scan: | ||
project: | ||
name: "nlohmann/json" | ||
description: "Build submitted via Travis CI" | ||
notification_email: [email protected] | ||
build_command_prepend: "make clean ; sudo cp $(which g++-5) $(which g++)" | ||
build_command: "make" | ||
branch_pattern: coverity_scan | ||
env: COMPILER=g++-5 | ||
|
||
- os: linux | ||
compiler: clang | ||
compiler: gcc | ||
addons: | ||
apt: | ||
sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-precise-3.6'] | ||
packages: ['clang-3.6', 'valgrind'] | ||
env: COMPILER=clang++-3.6 | ||
sources: ['ubuntu-toolchain-r-test'] | ||
packages: ['g++-6', 'valgrind'] | ||
env: COMPILER=g++-6 | ||
|
||
# from https://github.com/travis-ci/travis-ci/issues/6120 | ||
- os: linux | ||
env: | ||
- LLVM_VERSION=3.8.0 | ||
- LLVM_ARCHIVE_PATH=$HOME/clang+llvm.tar.xz | ||
- COMPILER=clang++ | ||
- CPPFLAGS="-I $HOME/clang-$LLVM_VERSION/include/c++/v1" | ||
- CXXFLAGS=-lc++ | ||
- PATH=$HOME/clang-$LLVM_VERSION/bin:$PATH | ||
- LD_LIBRARY_PATH=$HOME/clang-$LLVM_VERSION/lib:$LD_LIBRARY_PATH | ||
before_install: | ||
- wget http://llvm.org/releases/$LLVM_VERSION/clang+llvm-$LLVM_VERSION-x86_64-linux-gnu-ubuntu-14.04.tar.xz -O $LLVM_ARCHIVE_PATH | ||
- mkdir $HOME/clang-$LLVM_VERSION | ||
- tar xf $LLVM_ARCHIVE_PATH -C $HOME/clang-$LLVM_VERSION --strip-components 1 | ||
|
||
# Clang 3.5 is not able to compile the code, | ||
# see https://travis-ci.org/nlohmann/json/jobs/126720186 | ||
|
||
# - os: linux | ||
# compiler: clang | ||
# addons: | ||
# apt: | ||
# sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-precise-3.6'] | ||
# packages: ['clang-3.6', 'valgrind'] | ||
# env: COMPILER=clang++-3.6 | ||
# | ||
# - os: linux | ||
# compiler: clang | ||
# addons: | ||
# apt: | ||
# sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-precise-3.7'] | ||
# packages: ['clang-3.7', 'valgrind'] | ||
# env: COMPILER=clang++-3.7 | ||
# | ||
# - os: linux | ||
# compiler: clang | ||
# addons: | ||
# apt: | ||
# sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-precise-3.8'] | ||
# packages: ['clang-3.8', 'valgrind'] | ||
# env: COMPILER=clang++-3.8 | ||
|
||
# - os: linux | ||
# compiler: clang | ||
# addons: | ||
# apt: | ||
# sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-precise'] | ||
# packages: ['clang-3.9', 'valgrind'] | ||
# env: COMPILER=clang++-3.9 | ||
|
||
- os: osx | ||
osx_image: beta-xcode6.1 | ||
compiler: clang | ||
addons: | ||
apt: | ||
sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-precise-3.7'] | ||
packages: ['clang-3.7', 'valgrind'] | ||
env: COMPILER=clang++-3.7 | ||
env: | ||
- COMPILER=clang | ||
- CXXFLAGS=-lstdc++ | ||
|
||
- os: osx | ||
osx_image: beta-xcode6.2 | ||
compiler: clang | ||
env: | ||
- COMPILER=clang | ||
- CXXFLAGS=-lstdc++ | ||
|
||
- os: osx | ||
osx_image: beta-xcode6.3 | ||
compiler: clang | ||
env: | ||
- COMPILER=clang | ||
- CXXFLAGS=-lstdc++ | ||
|
||
- os: osx | ||
osx_image: xcode6.4 | ||
compiler: clang | ||
env: | ||
- COMPILER=clang | ||
- CXXFLAGS=-lstdc++ | ||
|
||
- os: osx | ||
osx_image: xcode7.1 | ||
compiler: clang | ||
env: | ||
- COMPILER=clang | ||
- CXXFLAGS=-lstdc++ | ||
|
||
# - os: osx | ||
# compiler: clang | ||
# env: COMPILER=clang | ||
# before_install: | ||
# - brew update | ||
# - brew install valgrind | ||
- os: osx | ||
osx_image: xcode7.2 | ||
compiler: clang | ||
env: | ||
- COMPILER=clang | ||
- CXXFLAGS=-lstdc++ | ||
|
||
- os: osx | ||
osx_image: xcode7.3 | ||
compiler: clang | ||
env: | ||
- COMPILER=clang | ||
- CXXFLAGS=-lstdc++ | ||
|
||
- os: osx | ||
osx_image: xcode8 | ||
compiler: clang | ||
env: | ||
- COMPILER=clang | ||
- CXXFLAGS=-lstdc++ | ||
|
||
script: | ||
- make CXX=$COMPILER CXXFLAGS="-lstdc++" | ||
- uname -a | ||
- $COMPILER --version | ||
- make CXX=$COMPILER | ||
- ./json_unit "*" | ||
- valgrind --error-exitcode=1 --leak-check=full ./json_unit | ||
|
||
notifications: | ||
webhooks: | ||
urls: | ||
- https://webhooks.gitter.im/e/f1196addb0e97a5ff396 | ||
on_success: change | ||
on_failure: always | ||
on_start: never | ||
- if [ `which valgrind` ]; then | ||
valgrind --error-exitcode=1 --leak-check=full ./json_unit ; | ||
fi |
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,25 +1,54 @@ | ||
cmake_minimum_required(VERSION 2.8) | ||
cmake_minimum_required(VERSION 3.0) | ||
|
||
project(json CXX) | ||
# define the project | ||
project(nlohmann_json VERSION 2.0.0 LANGUAGES CXX) | ||
|
||
add_executable(json_unit | ||
src/json.hpp test/catch.hpp test/unit.cpp | ||
) | ||
enable_testing() | ||
|
||
if(MSVC) | ||
set(CMAKE_CXX_FLAGS | ||
"/EHsc" | ||
) | ||
option(BuildTests "Build the unit tests" ON) | ||
|
||
STRING(REPLACE "/O2" "/Od" CMAKE_CXX_FLAGS_RELEASE ${CMAKE_CXX_FLAGS_RELEASE}) | ||
# define project variables | ||
set(JSON_TARGET_NAME ${PROJECT_NAME}) | ||
set(JSON_PACKAGE_NAME ${JSON_TARGET_NAME}) | ||
set(JSON_TARGETS_FILENAME "${JSON_PACKAGE_NAME}Targets.cmake") | ||
set(JSON_CONFIG_FILENAME "${JSON_PACKAGE_NAME}Config.cmake") | ||
set(JSON_CONFIGVERSION_FILENAME "${JSON_PACKAGE_NAME}ConfigVersion.cmake") | ||
set(JSON_CONFIG_DESTINATION "cmake") | ||
set(JSON_INCLUDE_DESTINATION "include/nlohmann") | ||
|
||
add_definitions(-D_SCL_SECURE_NO_WARNINGS) | ||
else(MSVC) | ||
set(CMAKE_CXX_FLAGS | ||
"-std=c++11" | ||
) | ||
endif(MSVC) | ||
# create and configure the library target | ||
add_library(${JSON_TARGET_NAME} INTERFACE) | ||
target_include_directories(${JSON_TARGET_NAME} INTERFACE | ||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src> | ||
$<INSTALL_INTERFACE:${JSON_INCLUDE_DESTINATION}>) | ||
|
||
include_directories( | ||
src test | ||
) | ||
# create and configure the unit test target | ||
if (BuildTests) | ||
add_subdirectory(test) | ||
endif() | ||
|
||
# generate a config and config version file for the package | ||
include(CMakePackageConfigHelpers) | ||
configure_package_config_file("cmake/config.cmake.in" | ||
"${CMAKE_CURRENT_BINARY_DIR}/${JSON_CONFIG_FILENAME}" | ||
INSTALL_DESTINATION ${JSON_CONFIG_DESTINATION}) | ||
write_basic_package_version_file("${CMAKE_CURRENT_BINARY_DIR}/${JSON_CONFIGVERSION_FILENAME}" | ||
VERSION ${PROJECT_VERSION} | ||
COMPATIBILITY SameMajorVersion) | ||
|
||
# export the library target and store build directory in package registry | ||
export(TARGETS ${JSON_TARGET_NAME} | ||
FILE "${CMAKE_CURRENT_BINARY_DIR}/${JSON_TARGETS_FILENAME}") | ||
export(PACKAGE ${JSON_PACKAGE_NAME}) | ||
|
||
# install library target and config files | ||
install(TARGETS ${JSON_TARGET_NAME} | ||
EXPORT ${JSON_PACKAGE_NAME}) | ||
install(FILES "src/json.hpp" | ||
DESTINATION ${JSON_INCLUDE_DESTINATION}) | ||
install(EXPORT ${JSON_PACKAGE_NAME} | ||
FILE ${JSON_TARGETS_FILENAME} | ||
DESTINATION ${JSON_CONFIG_DESTINATION}) | ||
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${JSON_CONFIG_FILENAME}" | ||
"${CMAKE_CURRENT_BINARY_DIR}/${JSON_CONFIGVERSION_FILENAME}" | ||
DESTINATION ${JSON_CONFIG_DESTINATION}) |
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
Oops, something went wrong.