Skip to content

Commit

Permalink
Merge branch 'nlohmann:develop' into patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
zel1b08a authored Dec 8, 2024
2 parents e41bfbc + 9f60e85 commit c859d64
Show file tree
Hide file tree
Showing 158 changed files with 1,065 additions and 354 deletions.
35 changes: 18 additions & 17 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,28 +35,29 @@ jobs:
# - name: Test
# run: cd build ; ctest -j 10 --output-on-failure

macos-12:
runs-on: macos-12 # https://github.com/actions/runner-images/blob/main/images/macos/macos-12-Readme.md
strategy:
matrix:
xcode: ['13.1', '13.2.1', '13.3.1', '13.4.1', '14.0', '14.0.1', '14.1']
env:
DEVELOPER_DIR: /Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer

steps:
- uses: actions/checkout@v4
- name: Run CMake
run: cmake -S . -B build -D CMAKE_BUILD_TYPE=Debug -DJSON_BuildTests=On -DJSON_FastTests=ON
- name: Build
run: cmake --build build --parallel 10
- name: Test
run: cd build ; ctest -j 10 --output-on-failure
# macos-12 is deprecated (https://github.com/actions/runner-images/issues/10721)
# macos-12:
# runs-on: macos-12 # https://github.com/actions/runner-images/blob/main/images/macos/macos-12-Readme.md
# strategy:
# matrix:
# xcode: ['13.1', '13.2.1', '13.3.1', '13.4.1', '14.0', '14.0.1', '14.1']
# env:
# DEVELOPER_DIR: /Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer
#
# steps:
# - uses: actions/checkout@v4
# - name: Run CMake
# run: cmake -S . -B build -D CMAKE_BUILD_TYPE=Debug -DJSON_BuildTests=On -DJSON_FastTests=ON
# - name: Build
# run: cmake --build build --parallel 10
# - name: Test
# run: cd build ; ctest -j 10 --output-on-failure

macos-13:
runs-on: macos-13 # https://github.com/actions/runner-images/blob/main/images/macos/macos-13-Readme.md
strategy:
matrix:
xcode: [ '14.2', '14.3', '14.3.1', '15.0.1', '15.1', '15.2']
xcode: ['14.1', '14.2', '14.3', '14.3.1', '15.0.1', '15.1', '15.2']
env:
DEVELOPER_DIR: /Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer

Expand Down
53 changes: 34 additions & 19 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,11 @@ jobs:

ci_test_gcc:
runs-on: ubuntu-latest
container: ghcr.io/nlohmann/json-ci:v2.4.0
container: gcc:latest
steps:
- uses: actions/checkout@v4
- name: Get latest CMake and ninja
uses: lukka/[email protected]
- name: Run CMake
run: cmake -S . -B build -DJSON_CI=On
- name: Build
Expand All @@ -46,14 +48,32 @@ jobs:
container: ghcr.io/nlohmann/json-ci:v2.4.0
strategy:
matrix:
target: [ci_cppcheck, ci_test_valgrind, ci_test_amalgamation, ci_test_single_header, ci_single_binaries, ci_infer]
target: [
ci_cppcheck, # needs cppcheck
ci_test_valgrind, # needs Valgrind
ci_test_amalgamation, # needs AStyle
ci_infer, # needs Infer
ci_single_binaries # needs iwyu
]
steps:
- uses: actions/checkout@v4
- name: Run CMake
run: cmake -S . -B build -DJSON_CI=On
- name: Build
run: cmake --build build --target ${{ matrix.target }}

ci_test_single_header:
runs-on: ubuntu-latest
container: gcc:latest
steps:
- uses: actions/checkout@v4
- name: Get latest CMake and ninja
uses: lukka/[email protected]
- name: Run CMake
run: cmake -S . -B build -DJSON_CI=On
- name: Build
run: cmake --build build --target ci_test_single_header

ci_static_analysis_ubuntu:
runs-on: ubuntu-latest
strategy:
Expand Down Expand Up @@ -104,23 +124,29 @@ jobs:

ci_test_coverage:
runs-on: ubuntu-latest
container: ghcr.io/nlohmann/json-ci:v2.4.0
permissions:
contents: read
checks: write
steps:
- uses: actions/checkout@v4
- name: Install dependencies and de_DE locale
run: |
sudo apt-get clean
sudo apt-get update
sudo apt-get install -y build-essential cmake lcov ninja-build make locales gcc-multilib g++-multilib
sudo locale-gen de_DE
sudo update-locale
- name: Run CMake
run: cmake -S . -B build -DJSON_CI=On
- name: Build
run: cmake --build build --target ci_test_coverage
- name: Archive coverage report
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: code-coverage-report
path: ${{ github.workspace }}/build/html
- name: Publish report to Coveralls
uses: coverallsapp/github-action@master
uses: coverallsapp/github-action@v2.3.4
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: ${{ github.workspace }}/build/json.info.filtered.noexcept
Expand Down Expand Up @@ -174,27 +200,16 @@ jobs:
- name: Build
run: cmake --build build --target ci_test_compiler_default

ci_test_compilers:
runs-on: ubuntu-latest
container: ghcr.io/nlohmann/json-ci:v2.4.0
strategy:
matrix:
compiler: [g++-4.8]
steps:
- uses: actions/checkout@v4
- name: Run CMake
run: cmake -S . -B build -DJSON_CI=On
- name: Build
run: cmake --build build --target ci_test_compiler_${{ matrix.compiler }}

ci_test_standards_gcc:
runs-on: ubuntu-latest
container: ghcr.io/nlohmann/json-ci:v2.4.0
container: gcc:latest
strategy:
matrix:
standard: [11, 14, 17, 20, 23]
steps:
- uses: actions/checkout@v4
- name: Get latest CMake and ninja
uses: lukka/[email protected]
- name: Run CMake
run: cmake -S . -B build -DJSON_CI=On
- name: Build
Expand Down
8 changes: 6 additions & 2 deletions .reuse/dep5
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,13 @@ Upstream-Contact: Niels Lohmann <[email protected]>
Source: https://github.com/nlohmann/json

Files: *
Copyright: 2013-2022 Niels Lohmann <https://nlohmann.me>
Copyright: 2013-2024 Niels Lohmann <https://nlohmann.me>
License: MIT

Files: include/nlohmann/thirdparty/hedley.hpp
Copyright: 2016-2021 Evan Nemerson <[email protected]>
License: CC0

Files: tests/thirdparty/doctest/*
Copyright: 2016-2021 Viktor Kirilov
License: MIT
Expand All @@ -16,7 +20,7 @@ Copyright: 2015-2017 Niels Lohmann
License: MIT

Files: tests/thirdparty/Fuzzer/*
Copyright: 2003-2022, LLVM Project.
Copyright: 2003-2022 LLVM Project.
License: Apache-2.0

Files: tests/thirdparty/imapdl/*
Expand Down
7 changes: 6 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ endif()
option(JSON_BuildTests "Build the unit tests when BUILD_TESTING is enabled." ${JSON_BuildTests_INIT})
option(JSON_CI "Enable CI build targets." OFF)
option(JSON_Diagnostics "Use extended diagnostic messages." OFF)
option(JSON_GlobalUDLs "Place use-defined string literals in the global namespace." ON)
option(JSON_GlobalUDLs "Place user-defined string literals in the global namespace." ON)
option(JSON_ImplicitConversions "Enable implicit conversions." ON)
option(JSON_DisableEnumSerialization "Disable default integer enum serialization." OFF)
option(JSON_LegacyDiscardedValueComparison "Enable legacy discarded value comparison." OFF)
Expand Down Expand Up @@ -96,6 +96,10 @@ if (JSON_Diagnostics)
message(STATUS "Diagnostics enabled")
endif()

if (NOT JSON_GlobalUDLs)
message(STATUS "User-defined string literals are not put in the global namespace")
endif()

if (JSON_SystemInclude)
set(NLOHMANN_JSON_SYSTEM_INCLUDE "SYSTEM")
endif()
Expand Down Expand Up @@ -145,6 +149,7 @@ endif()
CONFIGURE_FILE(
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/pkg-config.pc.in"
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc"
@ONLY
)

##
Expand Down
2 changes: 1 addition & 1 deletion LICENSE.MIT
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2013-2022 Niels Lohmann
Copyright (c) 2013-2024 Niels Lohmann

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,6 @@ serve_header:
##########################################################################

reuse:
pipx run reuse addheader --recursive single_include include -tjson --license MIT --copyright "Niels Lohmann <https://nlohmann.me>" --year "2013-2022"
pipx run reuse addheader $(TESTS_SRCS) --style=c -tjson_support --license MIT --copyright "Niels Lohmann <https://nlohmann.me>" --year "2013-2022"
pipx run reuse annotate --recursive single_include include -tjson --license MIT --copyright "Niels Lohmann <https://nlohmann.me>" --year "2013-2024" --merge-copyrights
pipx run reuse annotate $(TESTS_SRCS) -tjson_support --license MIT --copyright "Niels Lohmann <https://nlohmann.me>" --year "2013-2024" --merge-copyrights
pipx run reuse lint
32 changes: 18 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
- [Notes](#notes)
- [Execute unit tests](#execute-unit-tests)


## Design goals

There are myriads of [JSON](https://json.org) libraries out there, and each may even have its reason to exist. Our class had these design goals:
Expand All @@ -78,6 +79,7 @@ You can sponsor this library at [GitHub Sponsors](https://github.com/sponsors/nl
### :raising_hand: Priority Sponsor

- [Martti Laine](https://github.com/codeclown)
- [Paul Harrington](https://github.com/phrrngtn)

### :label: Named Sponsors

Expand All @@ -90,6 +92,7 @@ You can sponsor this library at [GitHub Sponsors](https://github.com/sponsors/nl

Thanks everyone!


## Support

:question: If you have a **question**, please check if it is already answered in the [**FAQ**](https://json.nlohmann.me/home/faq/) or the [**Q&A**](https://github.com/nlohmann/json/discussions/categories/q-a) section. If not, please [**ask a new question**](https://github.com/nlohmann/json/discussions/new) there.
Expand All @@ -102,6 +105,7 @@ Thanks everyone!

There is also a [**docset**](https://github.com/Kapeli/Dash-User-Contributions/tree/master/docsets/JSON_for_Modern_C%2B%2B) for the documentation browsers [Dash](https://kapeli.com/dash), [Velocity](https://velocity.silverlakesoftware.com), and [Zeal](https://zealdocs.org) that contains the full [documentation](https://json.nlohmann.me) as offline resource.


## Examples

Here are some examples to give you an idea how to use the class.
Expand Down Expand Up @@ -1115,7 +1119,7 @@ Though it's 2024 already, the support for C++11 is still a bit sparse. Currently
- GCC 4.8 - 14.2 (and possibly later)
- Clang 3.4 - 20.0 (and possibly later)
- Apple Clang 9.1 - 16.0 (and possibly later)
- Apple Clang 9.1 - 16.1 (and possibly later)
- Intel C++ Compiler 17.0.2 (and possibly later)
- Nvidia CUDA Compiler 11.0.221 (and possibly later)
- Microsoft Visual C++ 2015 / Build Tools 14.0.25123.0 (and possibly later)
Expand Down Expand Up @@ -1146,13 +1150,7 @@ The following compilers are currently used in continuous integration at [AppVeyo
| Compiler | Operating System | CI Provider |
|--------------------------------------------------------------------------------------------------------|--------------------|----------------|
| Apple Clang 13.0.0 (clang-1300.0.29.3); Xcode 13.1 | macOS 12.7.6 | GitHub Actions |
| Apple Clang 13.0.0 (clang-1300.0.29.30); Xcode 13.2.1 | macOS 12.7.6 | GitHub Actions |
| Apple Clang 13.1.6 (clang-1316.0.21.2.3); Xcode 13.3.1 | macOS 12.7.6 | GitHub Actions |
| Apple Clang 13.1.6 (clang-1316.0.21.2.5); Xcode 13.4.1 | macOS 12.7.6 | GitHub Actions |
| Apple Clang 14.0.0 (clang-1400.0.29.102); Xcode 14.0 | macOS 12.7.6 | GitHub Actions |
| Apple Clang 14.0.0 (clang-1400.0.29.102); Xcode 14.0.1 | macOS 12.7.6 | GitHub Actions |
| Apple Clang 14.0.0 (clang-1400.0.29.202); Xcode 14.1 | macOS 12.7.6 | GitHub Actions |
| Apple Clang 14.0.0 (clang-1400.0.29.202); Xcode 14.1 | macOS 13.7 | GitHub Actions |
| Apple Clang 14.0.0 (clang-1400.0.29.202); Xcode 14.2 | macOS 13.7 | GitHub Actions |
| Apple Clang 14.0.3 (clang-1403.0.22.14.1); Xcode 14.3 | macOS 13.7 | GitHub Actions |
| Apple Clang 14.0.3 (clang-1403.0.22.14.1); Xcode 14.3.1 | macOS 13.7.1 | GitHub Actions |
Expand Down Expand Up @@ -1393,11 +1391,11 @@ json = dependency('nlohmann_json', required: true)

## License

<img align="right" src="https://opensource.org/trademarks/opensource/OSI-Approved-License-100x137.png">
<img align="right" src="https://149753425.v2.pressablecdn.com/wp-content/uploads/2009/06/OSIApproved_100X125.png" alt="OSI approved license">

The class is licensed under the [MIT License](https://opensource.org/licenses/MIT):

Copyright &copy; 2013-2022 [Niels Lohmann](https://nlohmann.me)
Copyright &copy; 2013-2024 [Niels Lohmann](https://nlohmann.me)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

Expand All @@ -1407,13 +1405,19 @@ THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR I

* * *

The class contains the UTF-8 Decoder from Bjoern Hoehrmann which is licensed under the [MIT License](https://opensource.org/licenses/MIT) (see above). Copyright &copy; 2008-2009 [Björn Hoehrmann](https://bjoern.hoehrmann.de/) <[email protected]>
- The class contains the UTF-8 Decoder from Bjoern Hoehrmann which is licensed under the [MIT License](https://opensource.org/licenses/MIT) (see above). Copyright &copy; 2008-2009 [Björn Hoehrmann](https://bjoern.hoehrmann.de/) <[email protected]>
- The class contains a slightly modified version of the Grisu2 algorithm from Florian Loitsch which is licensed under the [MIT License](https://opensource.org/licenses/MIT) (see above). Copyright &copy; 2009 [Florian Loitsch](https://florian.loitsch.com/)
- The class contains a copy of [Hedley](https://nemequ.github.io/hedley/) from Evan Nemerson which is licensed as [CC0-1.0](https://creativecommons.org/publicdomain/zero/1.0/).
- The class contains parts of [Google Abseil](https://github.com/abseil/abseil-cpp) which is licensed under the [Apache 2.0 License](https://opensource.org/licenses/Apache-2.0).

The class contains a slightly modified version of the Grisu2 algorithm from Florian Loitsch which is licensed under the [MIT License](https://opensource.org/licenses/MIT) (see above). Copyright &copy; 2009 [Florian Loitsch](https://florian.loitsch.com/)
<img align="right" src="https://git.fsfe.org/reuse/reuse-ci/raw/branch/master/reuse-horizontal.png" alt="REUSE Software">

The class contains a copy of [Hedley](https://nemequ.github.io/hedley/) from Evan Nemerson which is licensed as [CC0-1.0](https://creativecommons.org/publicdomain/zero/1.0/).
The library is compliant to version 3.3 of the [**REUSE specification**](https://reuse.software):

The class contains parts of [Google Abseil](https://github.com/abseil/abseil-cpp) which is licensed under the [Apache 2.0 License](https://opensource.org/licenses/Apache-2.0).
- Every source file contains an SPDX copyright header.
- The full text of all licenses used in the repository can be found in the `LICENSES` folder.
- File `.reuse/dep5` contains an overview of all files' copyrights and licenses.
- Run `pipx run reuse lint` to verify the project's REUSE compliance and `pipx run reuse spdx` to generate a SPDX SBOM.

## Contact

Expand Down
Loading

0 comments on commit c859d64

Please sign in to comment.