wget: update to 1.19.4
[openadk.git] / package / systemd / patches / patch-meson_build
blobce1c3596ac99332427ca703c885afc5426820c24
1 --- systemd-236.orig/meson.build        2017-12-14 23:09:57.000000000 +0100
2 +++ systemd-236/meson.build     2018-01-01 21:03:50.570757021 +0100
3 @@ -260,10 +260,12 @@ cc = meson.get_compiler('c')
4  pkgconfig = import('pkgconfig')
5  check_compilation_sh = find_program('tools/meson-check-compilation.sh')
6  
7 -cxx = find_program('c++', required : false)
8 -if cxx.found()
9 -        #  Used only for tests
10 -        add_languages('cpp')
11 +if get_option('tests') != 'false'
12 +       cxx = find_program('c++', required : false)
13 +       if cxx.found()
14 +            #  Used only for tests
15 +            add_languages('cpp')
16 +    endif
17  endif
19  foreach arg : ['-Wextra',
20 @@ -2388,48 +2390,51 @@ executable('systemd-sulogin-shell',
21             install_dir : rootlibexecdir)
23  ############################################################
24 +if want_tests == 'false'
25 +        message('Not compiling because tests is set to false')
26 +else
27 +        foreach tuple : tests
28 +                sources = tuple[0]
29 +                link_with = tuple[1].length() > 0 ? tuple[1] : [libshared]
30 +                dependencies = tuple[2]
31 +                condition = tuple.length() >= 4 ? tuple[3] : ''
32 +                type = tuple.length() >= 5 ? tuple[4] : ''
33 +                defs = tuple.length() >= 6 ? tuple[5] : []
34 +                incs = tuple.length() >= 7 ? tuple[6] : includes
35 +                timeout = 30
37 -foreach tuple : tests
38 -        sources = tuple[0]
39 -        link_with = tuple[1].length() > 0 ? tuple[1] : [libshared]
40 -        dependencies = tuple[2]
41 -        condition = tuple.length() >= 4 ? tuple[3] : ''
42 -        type = tuple.length() >= 5 ? tuple[4] : ''
43 -        defs = tuple.length() >= 6 ? tuple[5] : []
44 -        incs = tuple.length() >= 7 ? tuple[6] : includes
45 -        timeout = 30
47 -        name = sources[0].split('/')[-1].split('.')[0]
48 -        if type.startswith('timeout=')
49 -                timeout = type.split('=')[1].to_int()
50 -                type = ''
51 -        endif
52 +                name = sources[0].split('/')[-1].split('.')[0]
53 +                if type.startswith('timeout=')
54 +                        timeout = type.split('=')[1].to_int()
55 +                        type = ''
56 +                endif
58 -        if condition == '' or conf.get(condition) == 1
59 -                exe = executable(
60 -                        name,
61 -                        sources,
62 -                        include_directories : incs,
63 -                        link_with : link_with,
64 -                        dependencies : dependencies,
65 -                        c_args : defs,
66 -                        install_rpath : rootlibexecdir,
67 -                        install : install_tests,
68 -                        install_dir : join_paths(testsdir, type))
69 +                if condition == '' or conf.get(condition) == 1
70 +                        exe = executable(
71 +                                name,
72 +                                sources,
73 +                                include_directories : incs,
74 +                                link_with : link_with,
75 +                                dependencies : dependencies,
76 +                                c_args : defs,
77 +                                install_rpath : rootlibexecdir,
78 +                                install : install_tests,
79 +                                install_dir : join_paths(testsdir, type))
81 -                if type == 'manual'
82 -                        message('@0@ is a manual test'.format(name))
83 -                elif type == 'unsafe' and want_tests != 'unsafe'
84 -                        message('@0@ is an unsafe test'.format(name))
85 +                        if type == 'manual'
86 +                                message('@0@ is a manual test'.format(name))
87 +                        elif type == 'unsafe' and want_tests != 'unsafe'
88 +                                message('@0@ is an unsafe test'.format(name))
89 +                        else
90 +                                test(name, exe,
91 +                                     env : test_env,
92 +                                     timeout : timeout)
93 +                        endif
94                  else
95 -                        test(name, exe,
96 -                             env : test_env,
97 -                             timeout : timeout)
98 +                        message('Not compiling @0@ because @1@ is not true'.format(name, condition))
99                  endif
100 -        else
101 -                message('Not compiling @0@ because @1@ is not true'.format(name, condition))
102 -        endif
103 -endforeach
104 +        endforeach
105 +endif
107  test_libsystemd_sym = executable(
108          'test-libsystemd-sym',