|
1 | 1 | project( |
2 | | - 'shared-library-guard', |
| 2 | + 'libloadguard', |
3 | 3 | 'c', |
4 | | - license : 'LGPL-2.1-or-later', |
5 | | - meson_version : '>=0.56.0', |
6 | | - version : '25.03.1', |
7 | | -) |
8 | | - |
9 | | -conf_data = configuration_data() |
10 | | -conf_data.set_quoted('SHARED_LIBRARY_GUARD_CONFIG', get_option('shared_library_guard_config')) |
11 | | -configure_file(output : 'config.h', configuration : conf_data) |
12 | | - |
13 | | - |
14 | | -shared_library('shared-library-guard', 'shared-library-guard.c', |
15 | | - install : true) |
16 | | - |
17 | | -install_data( |
18 | | - 'shared-library-guard-config-converter.py', |
19 | | - install_dir : get_option('bindir'), |
20 | | - rename : 'shared-library-guard-config-converter', |
21 | | - install_mode : 'rwxr-xr-x', |
| 4 | + license: 'LGPL-2.1-or-later', |
| 5 | + meson_version: '>=0.56.0', |
| 6 | + version: '26.05.0', |
| 7 | + default_options: 'c_std=gnu99', |
22 | 8 | ) |
23 | 9 |
|
| 10 | +cc = meson.get_compiler('c') |
| 11 | + |
| 12 | +project_c_args = [ |
| 13 | + '-Werror=empty-body', |
| 14 | + '-Werror=strict-prototypes', |
| 15 | + '-Werror=missing-prototypes', |
| 16 | + '-Werror=implicit-function-declaration', |
| 17 | + '-Werror=format=2', |
| 18 | + '-Werror=format-security', |
| 19 | + '-Werror=format-nonliteral', |
| 20 | + '-Werror=pointer-arith', |
| 21 | + '-Werror=init-self', |
| 22 | + '-Werror=missing-declarations', |
| 23 | + '-Werror=return-type', |
| 24 | + '-Werror=overflow', |
| 25 | + '-Werror=int-conversion', |
| 26 | + '-Werror=parentheses', |
| 27 | + '-Werror=incompatible-pointer-types', |
| 28 | + '-Werror=misleading-indentation', |
| 29 | + '-Werror=missing-include-dirs', |
| 30 | + '-D_GNU_SOURCE', |
| 31 | +] |
| 32 | + |
| 33 | +foreach arg: project_c_args |
| 34 | + if cc.has_argument(arg) |
| 35 | + add_project_arguments(arg, language: 'c') |
| 36 | + endif |
| 37 | +endforeach |
| 38 | + |
| 39 | +if cc.get_id() == 'clang' |
| 40 | + clang_args = [ |
| 41 | + '-Wno-typedef-redefinition', |
| 42 | + ] |
| 43 | + foreach arg: clang_args |
| 44 | + if cc.has_argument(arg) |
| 45 | + add_project_arguments(arg, language: 'c') |
| 46 | + endif |
| 47 | + endforeach |
| 48 | +endif |
24 | 49 |
|
| 50 | +subdir('src') |
| 51 | +subdir('utils') |
25 | 52 | if get_option('tests') |
26 | | - tester = executable('tester', 'tester.c') |
27 | | - test('empty_file', tester, args : ['tester', join_paths(meson.project_source_root(), 'test_data/empty_file.txt')]) |
28 | | - test('single_match', tester, args : ['tester', join_paths(meson.project_source_root(), 'test_data/single_library.txt'), '/foo/bar/baz.so']) |
29 | | - test('wrong_process', tester, args : ['tester2', join_paths(meson.project_source_root(), 'test_data/single_library.txt')]) |
30 | | - test('complex', tester, args : ['tester', join_paths(meson.project_source_root(), 'test_data/complex.txt'), '/foo/bar/baz.so', '/meep.so']) |
31 | | - test('absolute_path', tester, args : ['/foo/bar/tester', join_paths(meson.project_source_root(), 'test_data/single_library.txt'), '/foo/bar/baz.so']) |
32 | | - |
33 | | - test_match = executable('test_match', 'test_match.c') |
34 | | - |
35 | | - test('absolute_match', test_match, args : ['true', '/some/absolute/path', '/some/absolute/path']) |
36 | | - test('absolute_non_match', test_match, args : ['false', '/some/absolute/path', '/root/some/absolute/path']) |
37 | | - |
38 | | - test('relative_match', test_match, args : ['true', '*(/*)/relative/path', '/root/some/relative/path']) |
39 | | - test('relative_match', test_match, args : ['false', 'relative/path', '/root/some/relative/path/not/finished']) |
40 | | - |
41 | | - test('relative_match_hidden', test_match, args : ['false', '*(/*)/relative/path', '/root/.some/relative/path']) |
42 | | - test('relative_match_hidden', test_match, args : ['true', '*(/*|/.*)/relative/path', '/root/.some/relative/path']) |
| 53 | + subdir('tests') |
43 | 54 | endif |
0 commit comments