-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathmeson.build
More file actions
40 lines (33 loc) · 1.8 KB
/
meson.build
File metadata and controls
40 lines (33 loc) · 1.8 KB
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
project('wlpinyin',
['c'],
default_options : ['warning_level=3', 'c_std=c23'],
meson_version: '>=1.1',
)
add_project_arguments([
'-Wno-gnu-zero-variadic-macro-arguments', '-Wno-disabled-macro-expansion', '-Wno-strict-prototypes', '-Wno-unsafe-buffer-usage', '-Wno-empty-translation-unit',
'-Wformat',
'-D_GNU_SOURCE',
], language: 'c')
enable_popup = get_option('popup')
wl_client = dependency('wayland-client')
wl_protocols = dependency('wayland-protocols')
pinyin = dependency('rime')
xkbcommon = dependency('xkbcommon')
cc = meson.get_compiler('c')
rt = cc.find_library('rt', required: false)
scanner = find_program('wayland-scanner')
scanner_private_code = generator(scanner, output: '@BASENAME@-protocol.c', arguments: ['private-code', '@INPUT@', '@OUTPUT@'])
scanner_client_header = generator(scanner, output: '@BASENAME@-client-protocol.h', arguments: ['client-header', '@INPUT@', '@OUTPUT@'])
wl_protocols_dir = wl_protocols.get_variable(pkgconfig: 'pkgdatadir')
xdg_shell = wl_protocols_dir + '/stable/xdg-shell/xdg-shell.xml'
text_input_path = wl_protocols_dir + '/unstable/text-input/text-input-unstable-v3.xml'
protocols = ['input-method-unstable-v2.xml', text_input_path, 'virtual-keyboard-unstable-v1.xml', xdg_shell]
protocols_src = scanner_private_code.process(protocols)
protocols_headers = scanner_client_header.process(protocols)
protocols_dep = declare_dependency(sources: [protocols_src, protocols_headers], dependencies: wl_client)
popup_deps = []
if enable_popup.enabled()
add_project_arguments('-DENABLE_POPUP', language: 'c')
popup_deps = [dependency('cairo'), dependency('pangocairo')]
endif
executable('wlpinyin', ['main.c', 'im.c', 'rime_engine.c', 'config.c', 'popup_renderer.c', 'text_renderer.c'], dependencies: [wl_client, pinyin, xkbcommon, protocols_dep, rt] + popup_deps, install: true)