From 4b994877ae3ea44090f9d8c3e7f872951943c8ff Mon Sep 17 00:00:00 2001 From: Wook Song Date: Fri, 27 Mar 2020 17:07:02 +0900 Subject: [PATCH] meson: Add fallback mechanism to find iniparser In case that there are no cmake files or no pkg-config files for iniparser, this patch adds fallback mechanism to find it. Signed-off-by: Wook Song --- meson.build | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 9415a39..ffceec5 100644 --- a/meson.build +++ b/meson.build @@ -87,7 +87,17 @@ endif libm_dep = cxx.find_library('m') # cmath library libdl_dep = cxx.find_library('dl') # DL library thread_dep = dependency('threads') # pthread for tensorflow-lite -iniparser_dep = dependency('iniparser') # iniparser +iniparser_dep = dependency('iniparser', required : false) # iniparser +if not iniparser_dep.found() + message('falling back to find libiniparser library and header files') + libiniparser_dep = cxx.find_library('iniparser') + if libiniparser_dep.found() and cxx.has_header('iniparser.h', \ + args : '-I/usr/include/iniparser') + iniparser_dep = declare_dependency (dependencies : libiniparser_dep, + compile_args : '-I/usr/include/iniparser') + endif +endif + jsoncpp_dep = dependency('jsoncpp') # jsoncpp libcurl_dep = dependency('libcurl') -- 2.7.4