]> www.infradead.org Git - users/sagi/libnvme.git/commit
build: Add fallback dependency for json-c
authorDaniel Wagner <dwagner@suse.de>
Tue, 19 Oct 2021 08:15:32 +0000 (10:15 +0200)
committerDaniel Wagner <dwagner@suse.de>
Tue, 19 Oct 2021 08:52:38 +0000 (10:52 +0200)
commit6af90f95fd1bfcf6f7d37605a987e3cd2b860633
treec16a8bb4f5d2e86a8c7dbde9c92b5137136eb8cc
parent813c99d1cdcc8468b89ffd2b79f47e5da4c6a727
build: Add fallback dependency for json-c

meson supports embedded library build. This is very handy for system
which ship outdated an really outdated json-c library.

The include path for json.h has to be adapted. The json-c upstream
project is not clear which include prefix should be used ('#include
<json-c/json.h>" vs '#include <json.h>'. In order to support embedded
builds, we need to use the second version of the include. The source
code is added to the build, hence we use the include directory path of
the project layout. And json-c has all include files in the root
directory. This is no problem when using a installed version of json-c
as pkg-config adds '-I/usr/inlude/json-c' to the include paths:

  $pkg-config --cflags json-c
  -I/usr/include/json-c

So the simplest thing to support both build cased (external/embedded)
just drop the include prefix.

While at it also fix the 'requires' argument which expects strings not
dependencies objects.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
meson.build
src/Makefile
src/meson.build
src/nvme/json.c