aboutsummaryrefslogtreecommitdiff
path: root/meson.build
blob: ad5fdd158246998e123f6e09140698b5394758db (plain) (blame)
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
project('tatl',
        'c',
        version : '0.1.3',
        license : ['GPL-3.0-only'],
        default_options : [
          'buildtype=release',
          'c_std=c89',
          'strip=true',
          'warning_level=3',
        ])

library_path = []
project_source_files = []
project_header_files = []
project_test_files = []
project_benchmark_sources = []
public_header_files = [include_directories('include')]
project_build_args = [
  '-std=c89',
  '-Weverything',
  '-D_CRT_SECURE_NO_WARNINGS',
]
project_description = 'Tiny Test Framework for C89'

subdir('src')
subdir('include')

project_target = static_library(meson.project_name(),
                                project_source_files,
                                c_args : project_build_args,
                                gnu_symbol_visibility : 'hidden',
                                include_directories : public_header_files,
                                install : true)
project_dep = declare_dependency(include_directories : public_header_files,
                                 link_with : project_target)

set_variable(meson.project_name() + '_dep', project_dep)
subdir('examples')
subdir('tests')
install_headers(project_header_files, subdir : meson.project_name())

pkg_mod = import('pkgconfig')

import('pkgconfig').generate(description : project_description,
                             filebase : meson.project_name(),
                             libraries : project_target,
                             name : meson.project_name(),
                             subdirs : meson.project_name())

run_target('format',
           command : [
             'clang-format',
             '-i',
             '-style=LLVM',
             project_source_files,
             project_test_files,
             project_header_files,
           ])

if get_option('tidy')
  run_target('tidy',
            command : [
              'run-clang-tidy',
              # '-fix',
              '-j',
              '8',
              'files',
              '.', # '^((?!(fuwn)).)*$',
              '-format',
              '-p=' + meson.build_root()
            ])
endif