Commit Graph
43 Commits
Author SHA1 Message Date
Niels Lohmann 73b8a6a9c8 Add DisableTupleReferenceConversion to Meson and the CMake pkg-config file
JSON_DisableTupleReferenceConversion (#5598) came in with the develop
merge. Meson gets the matching option, and both the Meson and the CMake
pkg-config file carry JSON_DISABLE_TUPLE_REFERENCE_CONVERSION=1 when it
is enabled. The ci_meson_install job checks it.

Reported by @heitbaum in #5587.

Signed-off-by: Niels Lohmann <mail@nlohmann.me>
2026-10-01 14:16:08 +02:00
Niels Lohmann 9cbe62efb0 Fix the Meson CMake target for includedir or datadir outside the prefix
nlohmann_jsonTargets.cmake always prepended the prefix computed from the
file's location to includedir. With an absolute includedir outside the
prefix (as Nix passes for packages with a separate dev output), this gave
"<prefix>//abs/include"; with an absolute datadir outside the prefix, the
number of ".." was derived from the absolute path and the prefix resolved
to "/". In both cases find_package(nlohmann_json) failed with "Imported
target includes non-existent path". Use the absolute include directory in
these cases, as CMake's install(EXPORT) does, and check it in CI.

Signed-off-by: Niels Lohmann <mail@nlohmann.me>
2026-09-27 18:23:27 +02:00
Niels Lohmann cc9fafa0e1 Complete the Meson options and match CMake's compile definitions
Finish the Meson changes from #4452:

- Offer all eight options that change the CMake target, named like the
  CMake options without the JSON_ prefix. MultipleHeaders defaults to
  false so that existing Meson users keep the single header.
- Add a compile definition only for an option that differs from its
  default, exactly as target_compile_definitions does. Before, the
  GlobalUDLs and ImplicitConversions definitions were inverted and were
  also added in the default configuration.
- Keep the nlohmann_json_multiple_headers dependency that earlier
  versions of meson.build provided.
- Put the definitions into the pkg-config file and the Meson-generated
  nlohmann_jsonTargets.cmake, and install the pkg-config file into
  <datadir>/pkgconfig like CMake does.
- Ship meson_options.txt in include.zip, since meson.build now reads
  options and the zip is documented as a Meson subproject.

Signed-off-by: Niels Lohmann <mail@nlohmann.me>
2026-09-27 14:50:10 +02:00
Dylan Baker d75f9ab161 meson: add support for the ImplictConversions option
Signed-off-by: Dylan Baker <dylan@pnwbakers.com>
2026-09-27 14:47:04 +02:00
Dylan Baker c3774be4e2 meson: add support for the GlobalUDLs option
Signed-off-by: Dylan Baker <dylan@pnwbakers.com>
2026-09-27 14:47:03 +02:00
Dylan Baker 91365ca3b2 meson: handle single header and multiheader the same way CMake does
This uses a meson option (set in `meson_options.txt`) to control whether
multi-header or single-header setup is wanted.

Signed-off-by: Dylan Baker <dylan@pnwbakers.com>
2026-09-27 14:47:02 +02:00
Dylan Baker 605cc6c81d meson: set the C++ standard to C++11
Matching the CMake as closely as possible, as Meson doesn't have C++11
feature checks like CMAke does.

Signed-off-by: Dylan Baker <dylan@pnwbakers.com>
2026-09-27 14:47:01 +02:00
Dylan Baker f012b85d06 meson: use install_subdir for headers
This makes a single call to install the entire directory, and doesn't
need an update if any new headers are added. It also will simplify
bringing the Meson and CMake builds into allignment on how they handle
the multi-header vs single-header setups.

Signed-off-by: Dylan Baker <dylan@pnwbakers.com>
2026-09-27 14:46:56 +02:00
Dylan Baker 243b6e20e3 meson: use override_dependency() to set dependencies
This simplifies the use of json as a subproject.

Signed-off-by: Dylan Baker <dylan@pnwbakers.com>
2026-09-27 14:46:55 +02:00
Dylan Baker 0a0d5623be meson: set a minimum Meson version
Without a version set meson will give no developer warnings, including
deprecations. 0.64 was selected as it's quite old, it's the newest
version supported by muon (a pure C Meson implementation), and there's
nothing complicated going on here.

Signed-off-by: Dylan Baker <dylan@pnwbakers.com>
2026-09-27 14:46:55 +02:00
Dylan Baker 22c9ce3f21 meson: Indent code inside an if block
for better readability

Signed-off-by: Dylan Baker <dylan@pnwbakers.com>
2026-09-27 14:46:49 +02:00
Niels Lohmann 0d2240ad1e Install CMake package config files with Meson
A Meson installation only provided the headers and a pkg-config file, so
consumers using find_package(nlohmann_json) could not find the library.
Meson now also installs nlohmann_jsonConfig.cmake and
nlohmann_jsonConfigVersion.cmake from the existing templates, plus a
static nlohmann_jsonTargets.cmake that defines the header-only imported
target with a relocatable include path.

A new CI job installs with Meson and builds tests/cmake_import/project
against the result.

Closes #3885

Signed-off-by: Niels Lohmann <mail@nlohmann.me>
2026-09-27 14:25:10 +02:00
Niels Lohmann 1705bfe914 🔖 set version to 3.12.0 (#4727)
Signed-off-by: Niels Lohmann <mail@nlohmann.me>
2025-04-11 10:41:14 +02:00
Niels Lohmann 9cca280a4d JSON for Modern C++ 3.11.3 (#4222) 2023-11-28 22:36:31 +01:00
Niels Lohmann 9d69186291 🔖 set version to 3.11.2 2022-08-12 15:04:06 +02:00
Niels Lohmann e1a3fb74ba Add amalgamated json-fwd.hpp to release (#3687)
* 🔧 add amalgamated json-fwd.hpp to release

* 🔧 add amalgamated json-fwd.hpp to package managers
2022-08-07 20:33:34 +02:00
Niels Lohmann f2020da0dd 🔖 set version to 3.11.1 2022-08-01 23:27:58 +02:00
Niels Lohmann ce0e13ccea 🔖 set version to 3.11.0 2022-07-31 23:19:06 +02:00
Niels Lohmann b5364faf9d 🔖 set version to 3.10.5 2022-01-02 22:35:35 +01:00
Niels Lohmann a09bfa5faa 🔖 set version to 3.10.4 2021-10-16 13:34:31 +02:00
Niels Lohmann ab6a2c7425 🔖 set version to 3.10.3 2021-10-08 13:58:48 +02:00
Niels Lohmann 33b674b4b2 🔖 set version to 3.10.2 2021-08-26 08:13:04 +02:00
Niels Lohmann 8ad66e9136 🔖 set version to 3.10.1 2021-08-24 20:19:55 +02:00
Niels Lohmann 1de378f580 🔖 set version to 3.10.0 2021-08-17 15:23:23 +02:00
Niels Lohmann b3e5cb7f20 🔖 set version to 3.9.1 2020-08-06 13:45:29 +02:00
Niels Lohmann e110667d21 🔖 set version to 3.9.0 2020-07-27 15:48:09 +02:00
Niels Lohmann 5f862710fe 🔖 set version to 3.8.0 2020-06-14 17:16:45 +02:00
Niels Lohmann c5eafe74e8 🔖 set version to 3.7.3 2019-11-17 12:09:12 +01:00
Niels Lohmann 56109eacd7 🔖 set version to 3.7.2 2019-11-10 21:23:39 +01:00
Niels Lohmann aacdc6bbe3 🔖 set version to 3.7.1 2019-11-06 18:37:26 +01:00
Niels Lohmann 48e1fe03b5 🔖 set version to 3.7.0 2019-07-28 20:20:41 +02:00
Niels Lohmann efa1b9a7bb 🔖 set version to 3.6.1 2019-03-20 20:50:05 +01:00
Niels Lohmann b37392b7ac 🔖 set version to 3.6.0 2019-03-20 00:19:07 +01:00
Elvis Oric 77d1d37290 Disable installation when used as meson subproject. #1463 2019-01-30 11:40:14 +01:00
Niels Lohmann 78348afeb6 🔖 set version to 3.5.0 2018-12-21 23:52:29 +01:00
Millian Poquet ffe08983dd :meson: install headers + pkg-config 2018-11-08 00:25:42 +01:00
Niels Lohmann 7b2f8cce03 🔖 set version to 3.4.0 2018-10-30 21:30:20 +01:00
Niels Lohmann b968faa882 🔖 set version to 3.3.0 2018-10-05 10:59:33 +02:00
Kostiantyn Ponomarenko 8799759b85 Add version and license to meson.build 2018-09-20 21:54:10 +03:00
Julius Rakow ec2ebd5ec9 meson: add multiple headers target 2018-06-24 18:07:30 +02:00
Julius Rakow 0bb36bb140 meson: fix include directory 2018-06-24 18:07:30 +02:00
Niels Lohmann 0258484626 🔖 set version to 3.1.0
- updated documentation wrt. new repository layout
- temporarily switched off Homebrew --HEAD building (can only be switched on after release)
- set copyright date to 2018
2018-02-01 22:20:26 +01:00
Jay Sistar 31fe2f5825 Adding support for Meson. 2017-05-08 13:35:00 +00:00