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>
This commit is contained in:
Dylan Baker
2026-09-27 14:46:56 +02:00
committed by Niels Lohmann
parent 243b6e20e3
commit f012b85d06
+5 -2
View File
@@ -16,8 +16,11 @@ nlohmann_json_multiple_headers = declare_dependency(
meson.override_dependency('nlohmann_json_multiple_headers', nlohmann_json_multiple_headers)
if not meson.is_subproject()
install_headers('single_include/nlohmann/json.hpp', subdir: 'nlohmann')
install_headers('single_include/nlohmann/json_fwd.hpp', subdir: 'nlohmann')
install_subdir(
'single_include/nlohmann',
install_dir: get_option('includedir'),
install_tag: 'devel',
)
pkgc = import('pkgconfig')
pkgc.generate(name: 'nlohmann_json',