~sircmpwn/ctools

ref: f2d583864b4c95633f8897b3e1d44b2fa5352899 ctools/meson.build -rw-r--r-- 1.3 KiB View raw
f2d58386 — Gabor Koszegi Implement fold 2 months ago
                                                                                
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
project(
	'ctools',
	'c',
	version: '0.1.0',
	license: 'GPL-3.0-only',
	meson_version: '>=0.48.0',
	default_options: [
		'c_std=c99',
		'warning_level=2',
	],
)

oneshots = [
	'basename',
	'cat',
	'chgrp',
	'chmod',
	'chown',
	'cksum',
	'cmp',
	'comm',
	'dirname',
	'echo',
	'env',
	'false',
	'fold',
	'head',
	'logname',
	'nice', # Included in base but only effective under XSI
	'nohup',
	'pwd',
	'rmdir',
	'sleep',
	'tee',
	'true',
	'tty',
	'uname',
]

xsi_oneshots = [
	'link',
	'unlink',
]

cc = meson.get_compiler('c')

if get_option('xsi')
	add_project_arguments(['-D_XOPEN_SOURCE=700'], language: 'c')
	oneshots += xsi_oneshots
else
	add_project_arguments(['-D_POSIX_C_SOURCE=200809L'], language: 'c')
endif

add_project_arguments(cc.get_supported_arguments([
	'-Wundef',
	'-Wlogical-op',
	'-Wmissing-include-dirs',
	'-Wold-style-definition',
	'-Wpointer-arith',
	'-Winit-self',
	'-Wstrict-prototypes',
	'-Wimplicit-fallthrough=2',
	'-Wendif-labels',
	'-Wstrict-aliasing=2',
	'-Woverflow',

	'-Wno-missing-braces',
	'-Wno-missing-field-initializers',
	'-Wno-unused-parameter',
]), language: 'c')

foreach prog : oneshots
	executable(prog, ['src/' + prog + '.c'])
endforeach

scdoc = dependency('scdoc', native: true, required: get_option('man-pages'),
	version: '>=1.10.0')
if scdoc.found()
	subdir('doc')
endif

subdir('test')