2023-09-06 20:36:48 +02:00
|
|
|
wayland_protos = dependency('wayland-protocols',
|
|
|
|
version: '>=1.31',
|
|
|
|
default_options: ['tests=false'],
|
|
|
|
)
|
|
|
|
|
|
|
|
hyprland_protos = dependency('hyprland-protocols',
|
|
|
|
version: '>=0.2',
|
|
|
|
fallback: 'hyprland-protocols',
|
|
|
|
)
|
|
|
|
|
2022-05-05 22:04:22 +02:00
|
|
|
wl_protocol_dir = wayland_protos.get_variable('pkgdatadir')
|
2023-01-07 19:28:38 +01:00
|
|
|
hl_protocol_dir = hyprland_protos.get_variable('pkgdatadir')
|
2022-05-05 22:04:22 +02:00
|
|
|
|
2024-09-20 16:27:50 +02:00
|
|
|
hyprwayland_scanner_dep = dependency('hyprwayland-scanner', required: true, native: true, version: '>=0.4.2')
|
|
|
|
hyprwayland_scanner = find_program(
|
|
|
|
hyprwayland_scanner_dep.get_variable(pkgconfig: 'hyprwayland_scanner'),
|
|
|
|
native: true,
|
|
|
|
)
|
|
|
|
|
2020-02-19 22:55:51 +01:00
|
|
|
client_protocols = [
|
|
|
|
'wlr-screencopy-unstable-v1.xml',
|
2022-12-12 15:51:37 +01:00
|
|
|
'wlr-foreign-toplevel-management-unstable-v1.xml',
|
2023-09-06 20:36:48 +02:00
|
|
|
hl_protocol_dir / 'protocols/hyprland-toplevel-export-v1.xml',
|
|
|
|
hl_protocol_dir / 'protocols/hyprland-global-shortcuts-v1.xml',
|
|
|
|
wl_protocol_dir / 'unstable/linux-dmabuf/linux-dmabuf-unstable-v1.xml',
|
2020-02-19 22:55:51 +01:00
|
|
|
]
|
|
|
|
|
2021-04-17 12:06:16 +02:00
|
|
|
wl_proto_files = []
|
2020-01-24 23:31:01 +01:00
|
|
|
|
2020-02-19 22:55:51 +01:00
|
|
|
foreach xml: client_protocols
|
2024-09-20 16:27:50 +02:00
|
|
|
wl_proto_files += custom_target(
|
2021-04-17 12:06:16 +02:00
|
|
|
xml.underscorify() + '_c',
|
2020-01-24 23:31:01 +01:00
|
|
|
input: xml,
|
2024-09-20 16:27:50 +02:00
|
|
|
output: ['@BASENAME@.cpp', '@BASENAME@.hpp'],
|
|
|
|
command: [hyprwayland_scanner, '--client', '@INPUT@', '@OUTDIR@'],
|
2020-01-24 23:31:01 +01:00
|
|
|
)
|
2024-09-20 16:27:50 +02:00
|
|
|
endforeach
|
2020-01-24 23:31:01 +01:00
|
|
|
|
2024-09-20 16:27:50 +02:00
|
|
|
wayland_scanner = dependency('wayland-scanner')
|
|
|
|
wayland_scanner_dir = wayland_scanner.get_variable('pkgdatadir')
|
2020-01-24 23:31:01 +01:00
|
|
|
|
2024-09-20 16:27:50 +02:00
|
|
|
wayland_xml = wayland_scanner_dir / 'wayland.xml'
|
|
|
|
wayland_protocol = custom_target(
|
|
|
|
wayland_xml.underscorify(),
|
|
|
|
input: wayland_xml,
|
|
|
|
output: ['@BASENAME@.cpp', '@BASENAME@.hpp'],
|
|
|
|
command: [hyprwayland_scanner, '--wayland-enums', '--client', '@INPUT@', '@OUTDIR@'],
|
|
|
|
)
|
|
|
|
|
|
|
|
lib_client_protos = static_library(
|
|
|
|
'client_protos',
|
|
|
|
wl_proto_files + wayland_protocol,
|
|
|
|
)
|
|
|
|
|
|
|
|
client_protos = declare_dependency(
|
|
|
|
link_with: lib_client_protos,
|
|
|
|
sources: wl_proto_files + wayland_protocol
|
|
|
|
)
|