meson: use override_dependency() to set dependencies

This simplifies the use of json as a subproject.

Signed-off-by: Dylan Baker <dylan@pnwbakers.com>
This commit is contained in:
Dylan Baker
2026-09-27 14:46:55 +02:00
committed by Niels Lohmann
parent 0a0d5623be
commit 243b6e20e3
+2
View File
@@ -8,10 +8,12 @@ project('nlohmann_json',
nlohmann_json_dep = declare_dependency(
include_directories: include_directories('single_include')
)
meson.override_dependency('nlohmann_json', nlohmann_json_dep)
nlohmann_json_multiple_headers = declare_dependency(
include_directories: include_directories('include')
)
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')