mu: add soft dependency on json-glib

If it's available it will be used.
This commit is contained in:
djcb
2018-11-11 12:12:36 +02:00
parent 2aa299b3ac
commit 93bd1b8ce7
4 changed files with 29 additions and 0 deletions

View File

@ -20,12 +20,21 @@ include $(top_srcdir)/gtest.mk
# before decending into tests/
SUBDIRS= parser . tests
if HAVE_JSON_GLIB
json_srcs= \
mu-msg-json.c \
mu-msg-json.h
json_flag="-DHAVE_JSON_GLIB"
endif
AM_CFLAGS= \
$(WARN_CFLAGS) \
$(GMIME_CFLAGS) \
$(GLIB_CFLAGS) \
$(GUILE_CFLAGS) \
$(JSON_GLIB_CFLAGS) \
$(ASAN_CFLAGS) \
$(json_flag) \
-Wno-format-nonliteral \
-Wno-switch-enum \
-Wno-suggest-attribute=format \
@ -36,6 +45,7 @@ AM_CXXFLAGS= \
$(WARN_CXXFLAGS) \
$(GMIME_CFLAGS) \
$(GLIB_CFLAGS) \
$(JSON_GLIB_CFLAGS) \
$(XAPIAN_CXXFLAGS) \
$(GUILE_CFLAGS) \
$(ASAN_CXXFLAGS)
@ -76,6 +86,7 @@ libmu_la_SOURCES= \
mu-msg-file.h \
mu-msg-iter.cc \
mu-msg-iter.h \
$(json_srcs) \
mu-msg-part.c \
mu-msg-part.h \
mu-msg-prio.c \
@ -108,6 +119,7 @@ libmu_la_LIBADD= \
$(GMIME_LIBS) \
$(GLIB_LIBS) \
$(GUILE_LIBS) \
$(JSON_GLIB_LIBS) \
${builddir}/parser/libmuxparser.la
libmu_la_LDFLAGS= \

View File

@ -32,6 +32,7 @@ AM_CPPFLAGS=$(XAPIAN_CXXFLAGS) \
# use -Wno-unused-parameters, because some callbacks may not
# really need all the params they get
AM_CFLAGS= \
$(JSON_GLIB_CFLAGS) \
$(WARN_CFLAGS) \
$(ASAN_CFLAGS)
AM_CXXFLAGS= \