From f37cd7550285d9c2528e8a94991b91fe83af7b1e Mon Sep 17 00:00:00 2001 From: Martin Brodbeck Date: Fri, 11 Oct 2019 09:09:18 +0200 Subject: [PATCH] using system json lib if available (works on Arch Linux) --- meson.build | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/meson.build b/meson.build index 35b6250..bceed86 100644 --- a/meson.build +++ b/meson.build @@ -10,8 +10,14 @@ cmake = import('cmake') #csv = cmake.subproject('csv-parser') #csv_lib = csv.dependency('csv') -nlohmann = cmake.subproject('nlohmann_json', cmake_options : ['-DJSON_BuildTests=OFF', '-DCMAKE_BUILD_TYPE=Release']) -nlohmann_lib = nlohmann.dependency('nlohmann_json') + +nlohmann_lib = dependency('nlohmann_json', version : '>=3.5.0', required : false) + +if not nlohmann_lib.found() + nlohmann = cmake.subproject('nlohmann_json', + cmake_options : ['-DJSON_BuildTests=OFF', '-DCMAKE_BUILD_TYPE=Release']) + nlohmann_lib = nlohmann.dependency('nlohmann_json') +endif singleapp_proj = subproject('singleapplication') singleapp_lib = singleapp_proj.get_variable('singleapp_lib')