[go: up one dir, main page]

File: meson.build

package info (click to toggle)
criterion 2.3.3git1-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 3,832 kB
  • sloc: ansic: 17,852; cpp: 795; python: 72; sh: 27; makefile: 23
file content (113 lines) | stat: -rw-r--r-- 2,397 bytes parent folder | download
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
109
110
111
112
113
sources = files(
	'err.c',
	'mutex.c',

	'capi/specifiers.c',
	'capi/stream.c',

	'compat/alloc.c',
	'compat/kill.c',
	'compat/mockfile.c',
	'compat/path.c',
	'compat/pipe.c',
	'compat/process.c',
	'compat/processor.c',
	'compat/section.c',
	'compat/strtok.c',
	'compat/time.c',

	'core/abort.c',
	'core/assert.c',
	'core/client.c',
	'core/ordered-set.c',
	'core/report.c',
	'core/runner.c',
	'core/runner_coroutine.c',
	'core/stats.c',
	'core/test.c',

	'csptr/array.c',
	'csptr/mman.c',

	'entry/entry.c',
	'entry/options.c',
	'entry/params.c',

	'io/event.c',
	'io/file.c',
	'io/json.c',
	'io/output.c',
	'io/redirect.c',
	'io/tap.c',
	'io/xml.c',

	'log/logging.c',
	'log/normal.c',

	'protocol/connect.c',
	'protocol/messages.c',
	'protocol/protocol.c',

	'string/brz.c',
	'string/extglobmatch.c',
	'string/fmt.c',
	'string/i18n.c',
	'string/xxd.c',
)

if must_regenerate_pb
	protoc = find_program('protoc')
	protoc_gen_nanopb = find_program('protoc-gen-nanopb')

	gen_pb_py = meson.current_source_dir() + '/protocol/gen-pb.py'

	gen_pb = custom_target('gen-pb',
		input   : ['protocol/criterion.proto', 'protocol/criterion.options'],
		output  : ['criterion.pb.c', 'criterion.pb.h'],
		command : [gen_pb_py, protoc.path(), protoc_gen_nanopb.path(), '@INPUT0@', '@INPUT1@', meson.current_build_dir()])

	sources += gen_pb
else
	sources += 'protocol/criterion.pb.c'
endif

if get_option('diffs').enabled()
	sources += files('string/diff.c')
else
	sources += files('string/diff-stubs.c')
endif

if get_option('theories').enabled()
	sources += files('core/theories.c')
endif

configure_file(input         : 'config.h.in',
               output        : 'config.h',
               configuration : config)

libcriterion = both_libraries('criterion', sources,
	include_directories: [criterion_includedir],
	# extra args that we don't want to pass to tests, samples, etc
	c_args: [
		'-D__USE_MINGW_ANSI_STDIO',
	],
	version: '3.1.0',
	dependencies: deps,
	install: true,
	link_args: cc.get_supported_link_arguments([
		'-Wl,--exclude-libs,ALL',
	]),
)

criterion = declare_dependency(
	include_directories: [criterion_api],
	dependencies: deps,
	link_with: [libcriterion])

pkgconfig = import('pkgconfig')
pkgconfig.generate(
	name: meson.project_name(),
	description: 'A KISS, Cross platform unit testing framework for C and C++',
	url: 'https://snai.pe/git/criterion',
	libraries: [criterion],
)