Skip to content

Commit 7973293

Browse files
committed
add a CI job for explicit conversions on every os
1 parent 74b446f commit 7973293

File tree

2 files changed

+40
-2
lines changed

2 files changed

+40
-2
lines changed

.travis.yml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,11 @@ matrix:
145145
- os: osx
146146
osx_image: xcode12
147147

148+
- os: osx
149+
osx_image: xcode12
150+
env:
151+
- IMPLICIT_CONVERSIONS=OFF
152+
148153
# Linux / GCC
149154

150155
- os: linux
@@ -203,6 +208,16 @@ matrix:
203208
sources: ['ubuntu-toolchain-r-test']
204209
packages: ['g++-9', 'ninja-build']
205210

211+
- os: linux
212+
compiler: gcc
213+
env:
214+
- COMPILER=g++-9
215+
- IMPLICIT_CONVERSIONS=OFF
216+
addons:
217+
apt:
218+
sources: ['ubuntu-toolchain-r-test']
219+
packages: ['g++-9', 'ninja-build']
220+
206221
- os: linux
207222
compiler: gcc
208223
env:
@@ -315,10 +330,12 @@ script:
315330
- if [[ "${COMPILER}" != "" ]]; then export CXX=${COMPILER}; fi
316331
# by default, use the single-header version
317332
- if [[ "${MULTIPLE_HEADERS}" == "" ]]; then export MULTIPLE_HEADERS=OFF; fi
333+
# by default, use implicit conversions
334+
- if [[ "${IMPLICIT_CONVERSIONS}" == "" ]]; then export IMPLICIT_CONVERSIONS=ON; fi
318335

319336
# compile and execute unit tests
320337
- mkdir -p build && cd build
321-
- cmake .. ${CMAKE_OPTIONS} -DJSON_MultipleHeaders=${MULTIPLE_HEADERS} -DJSON_BuildTests=On -GNinja && cmake --build . --config Release
338+
- cmake .. ${CMAKE_OPTIONS} -DJSON_MultipleHeaders=${MULTIPLE_HEADERS} -DJSON_ImplicitConversions=${IMPLICIT_CONVERSIONS} -DJSON_BuildTests=On -GNinja && cmake --build . --config Release
322339
- ctest -C Release --timeout 2700 -V -j
323340
- cd ..
324341

appveyor.yml

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,27 +7,31 @@ environment:
77
platform: x86
88
CXX_FLAGS: ""
99
LINKER_FLAGS: ""
10+
CMAKE_OPTIONS: ""
1011
GENERATOR: Visual Studio 14 2015
1112

1213
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
1314
configuration: Debug
1415
platform: x86
1516
CXX_FLAGS: ""
1617
LINKER_FLAGS: ""
18+
CMAKE_OPTIONS: ""
1719
GENERATOR: Visual Studio 15 2017
1820

1921
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
2022
configuration: Debug
2123
platform: x86
2224
CXX_FLAGS: ""
2325
LINKER_FLAGS: ""
26+
CMAKE_OPTIONS: ""
2427
GENERATOR: Visual Studio 16 2019
2528

2629
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
2730
configuration: Debug
2831
platform: x64
2932
CXX_FLAGS: ""
3033
LINKER_FLAGS: ""
34+
CMAKE_OPTIONS: ""
3135
GENERATOR: Visual Studio 16 2019
3236

3337
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
@@ -36,6 +40,7 @@ environment:
3640
platform: x86
3741
CXX_FLAGS: ""
3842
LINKER_FLAGS: ""
43+
CMAKE_OPTIONS: ""
3944
GENERATOR: Ninja
4045

4146
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
@@ -44,13 +49,15 @@ environment:
4449
platform: x86
4550
CXX_FLAGS: ""
4651
LINKER_FLAGS: ""
52+
CMAKE_OPTIONS: ""
4753
GENERATOR: Ninja
4854

4955
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
5056
configuration: Release
5157
platform: x86
5258
CXX_FLAGS: ""
5359
LINKER_FLAGS: ""
60+
CMAKE_OPTIONS: ""
5461
GENERATOR: Visual Studio 14 2015
5562

5663
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
@@ -59,41 +66,55 @@ environment:
5966
name: with_win_header
6067
CXX_FLAGS: ""
6168
LINKER_FLAGS: ""
69+
CMAKE_OPTIONS: ""
6270
GENERATOR: Visual Studio 14 2015
6371

6472
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
6573
configuration: Release
6674
platform: x86
6775
CXX_FLAGS: "/permissive- /std:c++latest /utf-8"
6876
LINKER_FLAGS: ""
77+
CMAKE_OPTIONS: ""
6978
GENERATOR: Visual Studio 15 2017
7079

7180
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
7281
configuration: Release
7382
platform: x86
7483
CXX_FLAGS: ""
7584
LINKER_FLAGS: ""
85+
CMAKE_OPTIONS: "-DJSON_ImplicitConversions=OFF"
86+
GENERATOR: Visual Studio 16 2019
87+
88+
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
89+
configuration: Release
90+
platform: x64
91+
CXX_FLAGS: ""
92+
LINKER_FLAGS: ""
93+
CMAKE_OPTIONS: ""
7694
GENERATOR: Visual Studio 16 2019
7795

7896
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
7997
configuration: Release
8098
platform: x64
8199
CXX_FLAGS: ""
82100
LINKER_FLAGS: ""
101+
CMAKE_OPTIONS: ""
83102
GENERATOR: Visual Studio 14 2015
84103

85104
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
86105
configuration: Release
87106
platform: x64
88107
CXX_FLAGS: "/permissive- /std:c++latest /Zc:__cplusplus /utf-8 /F4000000"
89108
LINKER_FLAGS: "/STACK:4000000"
109+
CMAKE_OPTIONS: ""
90110
GENERATOR: Visual Studio 15 2017
91111

92112
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
93113
configuration: Release
94114
platform: x64
95115
CXX_FLAGS: ""
96116
LINKER_FLAGS: ""
117+
CMAKE_OPTIONS: ""
97118
GENERATOR: Visual Studio 16 2019
98119

99120
init:
@@ -112,7 +133,7 @@ before_build:
112133
# for with_win_header build, inject the inclusion of Windows.h to the single-header library
113134
- ps: if ($env:name -Eq "with_win_header") { $header_path = "single_include\nlohmann\json.hpp" }
114135
- ps: if ($env:name -Eq "with_win_header") { "#include <Windows.h>`n" + (Get-Content $header_path | Out-String) | Set-Content $header_path }
115-
- 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)
136+
- 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%")
116137

117138
build_script:
118139
- cmake --build . --config "%configuration%"

0 commit comments

Comments
 (0)