2025-02-24 19:45:27 +08:00
|
|
|
project('maomao', ['c', 'cpp'], version: '0.1.5')
|
2025-02-03 23:18:47 +08:00
|
|
|
|
|
|
|
|
subdir('protocols')
|
|
|
|
|
|
|
|
|
|
cc = meson.get_compiler('c')
|
|
|
|
|
libm = cc.find_library('m')
|
2025-02-24 19:45:27 +08:00
|
|
|
xcb = dependency('xcb', required: get_option('xwayland'))
|
|
|
|
|
xlibs = dependency('xcb-icccm', required: get_option('xwayland'))
|
2025-02-03 23:18:47 +08:00
|
|
|
wayland_server_dep = dependency('wayland-server')
|
2025-02-24 19:45:27 +08:00
|
|
|
wlroots_dep = dependency('wlroots', version: ['>=0.17.0', '<0.18.0'])
|
2025-02-03 23:18:47 +08:00
|
|
|
xkbcommon_dep = dependency('xkbcommon')
|
|
|
|
|
libinput_dep = dependency('libinput')
|
|
|
|
|
libwayland_client_dep = dependency('wayland-client')
|
|
|
|
|
|
|
|
|
|
c_args = [
|
|
|
|
|
'-g',
|
|
|
|
|
'-Wno-unused-function',
|
|
|
|
|
'-DWLR_USE_UNSTABLE',
|
|
|
|
|
'-D_POSIX_C_SOURCE=200809L',
|
2025-02-24 19:45:27 +08:00
|
|
|
'-DVERSION="@0@"'.format(meson.project_version()),
|
2025-02-03 23:18:47 +08:00
|
|
|
]
|
|
|
|
|
|
|
|
|
|
if xcb.found() and xlibs.found()
|
|
|
|
|
c_args += '-DXWAYLAND'
|
|
|
|
|
c_args += '-DIM'
|
2025-02-24 19:45:27 +08:00
|
|
|
endif
|
2025-02-03 23:18:47 +08:00
|
|
|
|
2025-02-24 19:45:27 +08:00
|
|
|
executable(
|
|
|
|
|
'maomao',
|
2025-02-15 18:35:22 +08:00
|
|
|
'maomao.c',
|
2025-02-03 23:18:47 +08:00
|
|
|
'util.c',
|
|
|
|
|
wayland_sources,
|
2025-02-24 19:45:27 +08:00
|
|
|
dependencies: [
|
2025-02-03 23:18:47 +08:00
|
|
|
libm,
|
|
|
|
|
xcb,
|
|
|
|
|
xlibs,
|
|
|
|
|
wayland_server_dep,
|
|
|
|
|
wlroots_dep,
|
|
|
|
|
xkbcommon_dep,
|
|
|
|
|
libinput_dep,
|
|
|
|
|
libwayland_client_dep,
|
|
|
|
|
],
|
2025-02-24 19:45:27 +08:00
|
|
|
install: true,
|
|
|
|
|
c_args: c_args,
|
2025-02-03 23:18:47 +08:00
|
|
|
)
|
|
|
|
|
|
2025-02-24 19:45:27 +08:00
|
|
|
sysconfdir = get_option('sysconfdir')
|
2025-02-04 07:17:44 +08:00
|
|
|
prefix = get_option('prefix')
|
2025-02-23 21:37:59 +08:00
|
|
|
|
2025-02-24 19:45:27 +08:00
|
|
|
config = configuration_data()
|
|
|
|
|
config.set('sysconfdir', sysconfdir)
|
|
|
|
|
config.set('prefix', prefix)
|
|
|
|
|
configure_file(
|
|
|
|
|
configuration: config,
|
|
|
|
|
input: 'config.in',
|
|
|
|
|
output: 'config.conf',
|
|
|
|
|
install_dir: join_paths(sysconfdir, 'maomao'),
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
desktop_install_dir = join_paths(prefix, 'share/wayland-sessions')
|
|
|
|
|
install_data('maomao.desktop', install_dir: desktop_install_dir)
|