build: Allow not to build tests

https://bugzilla.gnome.org/show_bug.cgi?id=634790

Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
This commit is contained in:
Quentin Glidic 2015-11-19 10:09:52 +01:00 committed by Marc-Antoine Perennou
parent 2f2c5649ef
commit da7a6a229b
2 changed files with 13 additions and 2 deletions

View File

@ -1,6 +1,9 @@
ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
SUBDIRS = libnotify docs tools tests
SUBDIRS = libnotify docs tools
if TESTS_ENABLED
SUBDIRS += tests
endif
pcdata_DATA = libnotify.pc
pcdatadir = $(libdir)/pkgconfig

View File

@ -94,7 +94,14 @@ AC_SUBST([pkg_modules])
PKG_CHECK_MODULES(PACKAGE, [$pkg_modules])
tests_modules="gtk+-3.0 >= $REQ_GTK_VERSION"
PKG_CHECK_MODULES(TESTS, [$tests_modules])
AC_ARG_ENABLE(tests,
[AS_HELP_STRING([--disable-tests],
[Do not build tests])],
,enable_tests=yes)
if test x$enable_tests = xyes ; then
PKG_CHECK_MODULES(TESTS, [$tests_modules])
fi
AM_CONDITIONAL(TESTS_ENABLED, test x$enable_tests = xyes)
GLIB_GENMARSHAL=`pkg-config --variable=glib_genmarshal glib-2.0`
AC_SUBST(GLIB_GENMARSHAL)
@ -210,6 +217,7 @@ echo "
source code location: ${srcdir}
cflags: ${CFLAGS}
Build tests: ${enable_tests}
Build docs: ${enable_docbook_docs}
"