aboutsummaryrefslogtreecommitdiff
path: root/package/wayland/0002-configure-add-option-to-disable-tests.patch
blob: 8c67d9a3bcaa6a1cf75b969d55927fb4c1de1425 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
From 33b025e04bf3fa94b74ea3325b3fd7c3f546bcb1 Mon Sep 17 00:00:00 2001
From: "Yann E. MORIN" <yann.morin.1998@free.fr>
Date: Sun, 5 Mar 2017 10:06:02 +0100
Subject: [PATCH] configure: add option to disable tests

When building for a product, tests are not needed.

Besides, one test requires a C++ compiler, which is not always
available.

So, add an option to configure to disable building tests altogether.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
---
Patch submitted upstream:
https://lists.freedesktop.org/archives/wayland-devel/2017-March/033359.html
---
 Makefile.am  | 3 ++-
 configure.ac | 8 ++++++++
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/Makefile.am b/Makefile.am
index d0c8bd3..9c2541d 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -143,7 +143,7 @@ libwayland_cursor_la_CFLAGS =			\
 	-I$(top_srcdir)/src			\
 	-DICONDIR=\"$(ICONDIR)\"
 
-
+if ENABLE_TESTS
 built_test_programs =				\
 	array-test				\
 	client-test				\
@@ -258,6 +258,7 @@ os_wrappers_test_LDADD = libtest-runner.la
 
 exec_fd_leak_checker_SOURCES = tests/exec-fd-leak-checker.c
 exec_fd_leak_checker_LDADD = libtest-runner.la
+endif
 
 EXTRA_DIST += tests/scanner-test.sh			\
 	tests/data/example.xml				\
diff --git a/configure.ac b/configure.ac
index b583bef..96a5575 100644
--- a/configure.ac
+++ b/configure.ac
@@ -87,10 +87,18 @@ AC_ARG_ENABLE([dtd-validation],
 	      [],
 	      [enable_dtd_validation=yes])
 
+AC_ARG_ENABLE([tests],
+	      [AC_HELP_STRING([--disable-tests],
+			      [Disable compilation of test programs])],
+	      [],
+	      [enable_tests=yes])
+
 AM_CONDITIONAL(USE_HOST_SCANNER, test "x$with_host_scanner" = xyes)
 
 AM_CONDITIONAL(ENABLE_LIBRARIES, test "x$enable_libraries" = xyes)
 
+AM_CONDITIONAL(ENABLE_TESTS, test "x$enable_tests" = "yes")
+
 AC_ARG_WITH(icondir, [  --with-icondir=<dir>    Look for cursor icons here],
 		     [  ICONDIR=$withval],
 		     [  ICONDIR=${datadir}/icons])
-- 
2.7.4