diya-shell/meson.build
2024-04-29 21:41:51 +02:00

70 lines
1.9 KiB
Meson

project('diya-shell',
['c'],
version: '0.1.0',
license: 'MIT',
meson_version: '>=0.58.0',
default_options: ['c_std=gnu11', 'warning_level=3'])
lib_so_version = '0'
add_project_arguments(
[
'-Wno-pedantic',
'-Werror=implicit-function-declaration',
'-Werror=return-type',
],
language: 'c')
gtk = dependency('gtk4')
wayland_client = dependency('wayland-client', version: '>=1.10.0')
# wayland_scanner is required, but we can find it without pkg-config
wayland_scanner = find_program('wayland-scanner')
# use system xdg-shell protocol when available
wayland_protocols = dependency('wayland-protocols', version: '>=1.16')
wl_protocol_dir = wayland_protocols.get_variable('pkgdatadir')
# pkg_config = import('pkgconfig')
# gnome = import('gnome')
gtk_layer_shell = dependency('gtk4-layer-shell-0', version: '>=1.0.2')
wayland_targets=[]
wl_protocols = [
wl_protocol_dir / 'staging/ext-session-lock/ext-session-lock-v1',
'protocols/wlr-foreign-toplevel-management-unstable-v1'
]
foreach proto : wl_protocols
xml = ''.join([proto,'.xml'])
header = ''.join([proto.split('/').get(-1),'.h'])
cfile = ''.join([proto.split('/').get(-1),'.c'])
wayland_targets += custom_target(header,output:header,input:xml,
command: [ wayland_scanner, 'client-header', '@INPUT@', '@OUTPUT@' ] )
wayland_targets += custom_target(cfile,output:cfile,input:xml,
command: [ wayland_scanner, 'public-code', '@INPUT@', '@OUTPUT@' ] )
endforeach
src = [
'src/base.c',
'src/launcher.c',
'src/background.c',
'src/wayland.c',
'src/shell.c',
'src/foreign.c',
'src/session.c',
'src/widgets/cairo-widget.c',
'src/widgets/cairo-box.c',
'src/widgets/cairo-window.c',
'src/widgets/cairo-image.c',
'src/widgets/cairo-text.c',
'src/main.c',
wayland_targets]
executable(
'diya-shell',
src,
dependencies: [gtk, gtk_layer_shell, wayland_client])