File: meson.build

package info (click to toggle)
wlrctl 0.2.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 256 kB
  • sloc: ansic: 1,885; xml: 910; makefile: 6
file content (81 lines) | stat: -rw-r--r-- 1,738 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
project(
	'wlrctl',
	'c',
	version: '0.2.2',
	license: 'MIT',
	default_options: [
		'c_std=c11',
		'warning_level=2',
		'werror=true',
	],
)

cc = meson.get_compiler('c')

datadir = get_option('datadir')
prefix = get_option('prefix')


add_project_arguments('-Wno-unused-parameter', language: 'c')
add_project_arguments('-Wno-missing-braces', language: 'c')

version = '"@0@"'.format(meson.project_version())
add_project_arguments('-DWLRCTL_VERSION=@0@'.format(version), language: 'c')

if cc.has_function('memfd_create')
  add_project_arguments('-DMEMFD_CREATE', language: 'c')
endif

xkbcommon = dependency('xkbcommon')
wayland_client = dependency('wayland-client')

subdir('protocol')

src_files = [
	'main.c',
	'ascii_raw_keymap.c',
	'keyboard.c',
	'pointer.c',
	'toplevel.c',
	'output.c',
	'util.c',
]

includes = include_directories('include')

executable(
	'wlrctl',
	files(src_files),
	dependencies: [
		client_protos,
		wayland_client,
		xkbcommon,
	],
	include_directories: [includes],
	install: true
)

scdoc = dependency('scdoc', native: true, required: get_option('man-pages'))
if scdoc.found()
	scdoc_cmd = find_program(scdoc.get_pkgconfig_variable('scdoc'), native: true)
	sh = find_program('sh', native: true)
	mandir = get_option('mandir')
	output = 'wlrctl.1'
	custom_target(
		output,
		input: 'wlrctl.1.scd',
		output: output,
		command: [sh, '-c', '@0@ < @INPUT@ > @1@'.format(scdoc_cmd.path(), output)],
		install: true,
		install_dir: '@0@/man1'.format(mandir)
	)
endif

if get_option('zsh-completions')
	zsh_completions = files('completions/zsh/_wlrctl')
	zsh_install_dir = join_paths(datadir, 'zsh', 'vendor-completions')
	install_data(zsh_completions, install_dir: zsh_install_dir)
endif


# vim: set ts=4 sw=4: