add a CI job for explicit conversions on every os

parent 74b446f5
...@@ -145,6 +145,11 @@ matrix: ...@@ -145,6 +145,11 @@ matrix:
- os: osx - os: osx
osx_image: xcode12 osx_image: xcode12
- os: osx
osx_image: xcode12
env:
- IMPLICIT_CONVERSIONS=OFF
# Linux / GCC # Linux / GCC
- os: linux - os: linux
...@@ -203,6 +208,16 @@ matrix: ...@@ -203,6 +208,16 @@ matrix:
sources: ['ubuntu-toolchain-r-test'] sources: ['ubuntu-toolchain-r-test']
packages: ['g++-9', 'ninja-build'] packages: ['g++-9', 'ninja-build']
- os: linux
compiler: gcc
env:
- COMPILER=g++-9
- IMPLICIT_CONVERSIONS=OFF
addons:
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['g++-9', 'ninja-build']
- os: linux - os: linux
compiler: gcc compiler: gcc
env: env:
...@@ -315,10 +330,12 @@ script: ...@@ -315,10 +330,12 @@ script:
- if [[ "${COMPILER}" != "" ]]; then export CXX=${COMPILER}; fi - if [[ "${COMPILER}" != "" ]]; then export CXX=${COMPILER}; fi
# by default, use the single-header version # by default, use the single-header version
- if [[ "${MULTIPLE_HEADERS}" == "" ]]; then export MULTIPLE_HEADERS=OFF; fi - if [[ "${MULTIPLE_HEADERS}" == "" ]]; then export MULTIPLE_HEADERS=OFF; fi
# by default, use implicit conversions
- if [[ "${IMPLICIT_CONVERSIONS}" == "" ]]; then export IMPLICIT_CONVERSIONS=ON; fi
# compile and execute unit tests # compile and execute unit tests
- mkdir -p build && cd build - mkdir -p build && cd build
- cmake .. ${CMAKE_OPTIONS} -DJSON_MultipleHeaders=${MULTIPLE_HEADERS} -DJSON_BuildTests=On -GNinja && cmake --build . --config Release - cmake .. ${CMAKE_OPTIONS} -DJSON_MultipleHeaders=${MULTIPLE_HEADERS} -DJSON_ImplicitConversions=${IMPLICIT_CONVERSIONS} -DJSON_BuildTests=On -GNinja && cmake --build . --config Release
- ctest -C Release --timeout 2700 -V -j - ctest -C Release --timeout 2700 -V -j
- cd .. - cd ..
......
...@@ -7,6 +7,7 @@ environment: ...@@ -7,6 +7,7 @@ environment:
platform: x86 platform: x86
CXX_FLAGS: "" CXX_FLAGS: ""
LINKER_FLAGS: "" LINKER_FLAGS: ""
CMAKE_OPTIONS: ""
GENERATOR: Visual Studio 14 2015 GENERATOR: Visual Studio 14 2015
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
...@@ -14,6 +15,7 @@ environment: ...@@ -14,6 +15,7 @@ environment:
platform: x86 platform: x86
CXX_FLAGS: "" CXX_FLAGS: ""
LINKER_FLAGS: "" LINKER_FLAGS: ""
CMAKE_OPTIONS: ""
GENERATOR: Visual Studio 15 2017 GENERATOR: Visual Studio 15 2017
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019 - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
...@@ -21,6 +23,7 @@ environment: ...@@ -21,6 +23,7 @@ environment:
platform: x86 platform: x86
CXX_FLAGS: "" CXX_FLAGS: ""
LINKER_FLAGS: "" LINKER_FLAGS: ""
CMAKE_OPTIONS: ""
GENERATOR: Visual Studio 16 2019 GENERATOR: Visual Studio 16 2019
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019 - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
...@@ -28,6 +31,7 @@ environment: ...@@ -28,6 +31,7 @@ environment:
platform: x64 platform: x64
CXX_FLAGS: "" CXX_FLAGS: ""
LINKER_FLAGS: "" LINKER_FLAGS: ""
CMAKE_OPTIONS: ""
GENERATOR: Visual Studio 16 2019 GENERATOR: Visual Studio 16 2019
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
...@@ -36,6 +40,7 @@ environment: ...@@ -36,6 +40,7 @@ environment:
platform: x86 platform: x86
CXX_FLAGS: "" CXX_FLAGS: ""
LINKER_FLAGS: "" LINKER_FLAGS: ""
CMAKE_OPTIONS: ""
GENERATOR: Ninja GENERATOR: Ninja
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
...@@ -44,6 +49,7 @@ environment: ...@@ -44,6 +49,7 @@ environment:
platform: x86 platform: x86
CXX_FLAGS: "" CXX_FLAGS: ""
LINKER_FLAGS: "" LINKER_FLAGS: ""
CMAKE_OPTIONS: ""
GENERATOR: Ninja GENERATOR: Ninja
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
...@@ -51,6 +57,7 @@ environment: ...@@ -51,6 +57,7 @@ environment:
platform: x86 platform: x86
CXX_FLAGS: "" CXX_FLAGS: ""
LINKER_FLAGS: "" LINKER_FLAGS: ""
CMAKE_OPTIONS: ""
GENERATOR: Visual Studio 14 2015 GENERATOR: Visual Studio 14 2015
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
...@@ -59,6 +66,7 @@ environment: ...@@ -59,6 +66,7 @@ environment:
name: with_win_header name: with_win_header
CXX_FLAGS: "" CXX_FLAGS: ""
LINKER_FLAGS: "" LINKER_FLAGS: ""
CMAKE_OPTIONS: ""
GENERATOR: Visual Studio 14 2015 GENERATOR: Visual Studio 14 2015
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
...@@ -66,6 +74,7 @@ environment: ...@@ -66,6 +74,7 @@ environment:
platform: x86 platform: x86
CXX_FLAGS: "/permissive- /std:c++latest /utf-8" CXX_FLAGS: "/permissive- /std:c++latest /utf-8"
LINKER_FLAGS: "" LINKER_FLAGS: ""
CMAKE_OPTIONS: ""
GENERATOR: Visual Studio 15 2017 GENERATOR: Visual Studio 15 2017
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019 - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
...@@ -73,6 +82,15 @@ environment: ...@@ -73,6 +82,15 @@ environment:
platform: x86 platform: x86
CXX_FLAGS: "" CXX_FLAGS: ""
LINKER_FLAGS: "" LINKER_FLAGS: ""
CMAKE_OPTIONS: "-DJSON_ImplicitConversions=OFF"
GENERATOR: Visual Studio 16 2019
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
configuration: Release
platform: x64
CXX_FLAGS: ""
LINKER_FLAGS: ""
CMAKE_OPTIONS: ""
GENERATOR: Visual Studio 16 2019 GENERATOR: Visual Studio 16 2019
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
...@@ -80,6 +98,7 @@ environment: ...@@ -80,6 +98,7 @@ environment:
platform: x64 platform: x64
CXX_FLAGS: "" CXX_FLAGS: ""
LINKER_FLAGS: "" LINKER_FLAGS: ""
CMAKE_OPTIONS: ""
GENERATOR: Visual Studio 14 2015 GENERATOR: Visual Studio 14 2015
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
...@@ -87,6 +106,7 @@ environment: ...@@ -87,6 +106,7 @@ environment:
platform: x64 platform: x64
CXX_FLAGS: "/permissive- /std:c++latest /Zc:__cplusplus /utf-8 /F4000000" CXX_FLAGS: "/permissive- /std:c++latest /Zc:__cplusplus /utf-8 /F4000000"
LINKER_FLAGS: "/STACK:4000000" LINKER_FLAGS: "/STACK:4000000"
CMAKE_OPTIONS: ""
GENERATOR: Visual Studio 15 2017 GENERATOR: Visual Studio 15 2017
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019 - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
...@@ -94,6 +114,7 @@ environment: ...@@ -94,6 +114,7 @@ environment:
platform: x64 platform: x64
CXX_FLAGS: "" CXX_FLAGS: ""
LINKER_FLAGS: "" LINKER_FLAGS: ""
CMAKE_OPTIONS: ""
GENERATOR: Visual Studio 16 2019 GENERATOR: Visual Studio 16 2019
init: init:
...@@ -112,7 +133,7 @@ before_build: ...@@ -112,7 +133,7 @@ before_build:
# for with_win_header build, inject the inclusion of Windows.h to the single-header library # for with_win_header build, inject the inclusion of Windows.h to the single-header library
- ps: if ($env:name -Eq "with_win_header") { $header_path = "single_include\nlohmann\json.hpp" } - ps: if ($env:name -Eq "with_win_header") { $header_path = "single_include\nlohmann\json.hpp" }
- ps: if ($env:name -Eq "with_win_header") { "#include <Windows.h>`n" + (Get-Content $header_path | Out-String) | Set-Content $header_path } - ps: if ($env:name -Eq "with_win_header") { "#include <Windows.h>`n" + (Get-Content $header_path | Out-String) | Set-Content $header_path }
- if "%GENERATOR%"=="Ninja" (cmake . -G "%GENERATOR%" -DCMAKE_BUILD_TYPE="%configuration%" -DCMAKE_CXX_FLAGS="%CXX_FLAGS%" -DCMAKE_EXE_LINKER_FLAGS="%LINKER_FLAGS%" -DCMAKE_IGNORE_PATH="C:/Program Files/Git/usr/bin" -DJSON_BuildTests=On) else (cmake . -G "%GENERATOR%" -A "%GENERATOR_PLATFORM%" -DCMAKE_CXX_FLAGS="%CXX_FLAGS%" -DCMAKE_EXE_LINKER_FLAGS="%LINKER_FLAGS%" -DCMAKE_IGNORE_PATH="C:/Program Files/Git/usr/bin" -DJSON_BuildTests=On) - if "%GENERATOR%"=="Ninja" (cmake . -G "%GENERATOR%" -DCMAKE_BUILD_TYPE="%configuration%" -DCMAKE_CXX_FLAGS="%CXX_FLAGS%" -DCMAKE_EXE_LINKER_FLAGS="%LINKER_FLAGS%" -DCMAKE_IGNORE_PATH="C:/Program Files/Git/usr/bin" -DJSON_BuildTests=On "%CMAKE_OPTIONS%") else (cmake . -G "%GENERATOR%" -A "%GENERATOR_PLATFORM%" -DCMAKE_CXX_FLAGS="%CXX_FLAGS%" -DCMAKE_EXE_LINKER_FLAGS="%LINKER_FLAGS%" -DCMAKE_IGNORE_PATH="C:/Program Files/Git/usr/bin" -DJSON_BuildTests=On "%CMAKE_OPTIONS%")
build_script: build_script:
- cmake --build . --config "%configuration%" - cmake --build . --config "%configuration%"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment