summaryrefslogtreecommitdiff
path: root/package/systemd/patches/patch-meson_build
blob: ce1c3596ac99332427ca703c885afc5426820c24 (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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
--- systemd-236.orig/meson.build	2017-12-14 23:09:57.000000000 +0100
+++ systemd-236/meson.build	2018-01-01 21:03:50.570757021 +0100
@@ -260,10 +260,12 @@ cc = meson.get_compiler('c')
 pkgconfig = import('pkgconfig')
 check_compilation_sh = find_program('tools/meson-check-compilation.sh')
 
-cxx = find_program('c++', required : false)
-if cxx.found()
-        #  Used only for tests
-        add_languages('cpp')
+if get_option('tests') != 'false'
+	cxx = find_program('c++', required : false)
+	if cxx.found()
+            #  Used only for tests
+            add_languages('cpp')
+    endif
 endif
 
 foreach arg : ['-Wextra',
@@ -2388,48 +2390,51 @@ executable('systemd-sulogin-shell',
            install_dir : rootlibexecdir)
 
 ############################################################
+if want_tests == 'false'
+        message('Not compiling because tests is set to false')
+else
+        foreach tuple : tests
+                sources = tuple[0]
+                link_with = tuple[1].length() > 0 ? tuple[1] : [libshared]
+                dependencies = tuple[2]
+                condition = tuple.length() >= 4 ? tuple[3] : ''
+                type = tuple.length() >= 5 ? tuple[4] : ''
+                defs = tuple.length() >= 6 ? tuple[5] : []
+                incs = tuple.length() >= 7 ? tuple[6] : includes
+                timeout = 30
 
-foreach tuple : tests
-        sources = tuple[0]
-        link_with = tuple[1].length() > 0 ? tuple[1] : [libshared]
-        dependencies = tuple[2]
-        condition = tuple.length() >= 4 ? tuple[3] : ''
-        type = tuple.length() >= 5 ? tuple[4] : ''
-        defs = tuple.length() >= 6 ? tuple[5] : []
-        incs = tuple.length() >= 7 ? tuple[6] : includes
-        timeout = 30
-
-        name = sources[0].split('/')[-1].split('.')[0]
-        if type.startswith('timeout=')
-                timeout = type.split('=')[1].to_int()
-                type = ''
-        endif
+                name = sources[0].split('/')[-1].split('.')[0]
+                if type.startswith('timeout=')
+                        timeout = type.split('=')[1].to_int()
+                        type = ''
+                endif
 
-        if condition == '' or conf.get(condition) == 1
-                exe = executable(
-                        name,
-                        sources,
-                        include_directories : incs,
-                        link_with : link_with,
-                        dependencies : dependencies,
-                        c_args : defs,
-                        install_rpath : rootlibexecdir,
-                        install : install_tests,
-                        install_dir : join_paths(testsdir, type))
+                if condition == '' or conf.get(condition) == 1
+                        exe = executable(
+                                name,
+                                sources,
+                                include_directories : incs,
+                                link_with : link_with,
+                                dependencies : dependencies,
+                                c_args : defs,
+                                install_rpath : rootlibexecdir,
+                                install : install_tests,
+                                install_dir : join_paths(testsdir, type))
 
-                if type == 'manual'
-                        message('@0@ is a manual test'.format(name))
-                elif type == 'unsafe' and want_tests != 'unsafe'
-                        message('@0@ is an unsafe test'.format(name))
+                        if type == 'manual'
+                                message('@0@ is a manual test'.format(name))
+                        elif type == 'unsafe' and want_tests != 'unsafe'
+                                message('@0@ is an unsafe test'.format(name))
+                        else
+                                test(name, exe,
+                                     env : test_env,
+                                     timeout : timeout)
+                        endif
                 else
-                        test(name, exe,
-                             env : test_env,
-                             timeout : timeout)
+                        message('Not compiling @0@ because @1@ is not true'.format(name, condition))
                 endif
-        else
-                message('Not compiling @0@ because @1@ is not true'.format(name, condition))
-        endif
-endforeach
+        endforeach
+endif
 
 test_libsystemd_sym = executable(
         'test-libsystemd-sym',