summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQuentin Glidic <sardemff7+git@sardemff7.net>2015-11-19 10:09:52 +0100
committerMarc-Antoine Perennou <Marc-Antoine@Perennou.com>2016-06-14 16:07:31 +0200
commitda7a6a229b81501a15795d8766731b8523770959 (patch)
tree3ed7eb8dc87e6c17a7a0aff71f8397dd7776c068
parent2f2c5649ef210b1dffeb46cddf062d20e1518ccf (diff)
downloadlibnotify-da7a6a229b81501a15795d8766731b8523770959.tar.gz
build: Allow not to build tests
https://bugzilla.gnome.org/show_bug.cgi?id=634790 Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
-rw-r--r--Makefile.am5
-rw-r--r--configure.ac10
2 files changed, 13 insertions, 2 deletions
diff --git a/Makefile.am b/Makefile.am
index 9e12a02..3a28de2 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -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
diff --git a/configure.ac b/configure.ac
index dcc1667..632e80d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -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}
"