-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
barcode
committed
Jan 4, 2023
1 parent
2325486
commit 3758407
Showing
1 changed file
with
53 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
######################### | ||
# project configuration # | ||
######################### | ||
|
||
# C++ project | ||
language: cpp | ||
|
||
dist: jammy | ||
sudo: required | ||
group: edge | ||
arch: arm64 | ||
|
||
################ | ||
# build matrix # | ||
################ | ||
|
||
matrix: | ||
include: | ||
# Linux / GCC | ||
|
||
- os: linux | ||
compiler: gcc | ||
env: | ||
- COMPILER=g++-12 | ||
- CXX_STANDARD=20 | ||
addons: | ||
apt: | ||
sources: ['ubuntu-toolchain-r-test'] | ||
packages: ['g++-12', 'ninja-build'] | ||
|
||
################ | ||
# build script # | ||
################ | ||
|
||
script: | ||
# 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 | ||
|
||
# append CXX_STANDARD to CMAKE_OPTIONS if required | ||
- CMAKE_OPTIONS+=${CXX_STANDARD:+ -DCMAKE_CXX_STANDARD=$CXX_STANDARD -DCMAKE_CXX_STANDARD_REQUIRED=ON} | ||
|
||
# build configuration | ||
- CMAKE_OPTIONS+=" -DCMAKE_BUILD_TYPE=Debug" | ||
|
||
# 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 . | ||
- ctest --timeout 2700 -V -j | ||
- cd .. |