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 2024-09-09 10:00:25 -07:00
parent ea92dd89a9
commit 6fede3b397

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',