2017-03-20 00:36:38 +00:00
|
|
|
gdk_wayland_sources = files([
|
|
|
|
'gdkapplaunchcontext-wayland.c',
|
|
|
|
'gdkcursor-wayland.c',
|
|
|
|
'gdkdevice-wayland.c',
|
|
|
|
'gdkdisplay-wayland.c',
|
|
|
|
'gdkdnd-wayland.c',
|
2017-03-20 00:37:09 +00:00
|
|
|
'gdkeventsource.c',
|
2017-03-20 00:36:38 +00:00
|
|
|
'gdkglcontext-wayland.c',
|
|
|
|
'gdkkeys-wayland.c',
|
|
|
|
'gdkmonitor-wayland.c',
|
|
|
|
'gdkscreen-wayland.c',
|
|
|
|
'gdkselection-wayland.c',
|
|
|
|
'gdkvulkancontext-wayland.c',
|
|
|
|
'gdkwindow-wayland.c',
|
|
|
|
'wm-button-layout-translation.c',
|
|
|
|
])
|
|
|
|
|
|
|
|
gdk_wayland_public_headers = files([
|
|
|
|
'gdkwaylanddevice.h',
|
|
|
|
'gdkwaylanddisplay.h',
|
|
|
|
'gdkwaylandglcontext.h',
|
|
|
|
'gdkwaylandmonitor.h',
|
|
|
|
'gdkwaylandselection.h',
|
|
|
|
'gdkwaylandwindow.h'
|
|
|
|
])
|
|
|
|
|
|
|
|
install_headers(gdk_wayland_public_headers, subdir: 'gtk-4.0/gdk/wayland/')
|
|
|
|
install_headers('gdkwayland.h', subdir: 'gtk-4.0/gdk/')
|
|
|
|
|
|
|
|
gdk_wayland_deps = [
|
|
|
|
shmlib,
|
|
|
|
xkbdep,
|
|
|
|
wlclientdep,
|
|
|
|
wlprotocolsdep,
|
|
|
|
wlcursordep,
|
|
|
|
wlegldep,
|
|
|
|
]
|
|
|
|
|
|
|
|
# wayland protocols
|
2017-03-19 20:50:58 +00:00
|
|
|
proto_dir = dependency('wayland-protocols').get_pkgconfig_variable('pkgdatadir')
|
|
|
|
assert(proto_dir != '', 'Could not get pkgdatadir from wayland-protocols.pc')
|
2016-09-20 15:46:30 +00:00
|
|
|
|
2017-03-19 20:50:58 +00:00
|
|
|
wayland_scanner = find_program('wayland-scanner')
|
|
|
|
genprotocols = find_program('genprotocolfiles.py')
|
2016-09-10 18:40:02 +00:00
|
|
|
|
2017-04-26 14:16:21 +00:00
|
|
|
# Format:
|
|
|
|
# - protocol name
|
|
|
|
# - protocol stability ('stable' or 'unstable')
|
|
|
|
# - protocol version (if stability is 'unstable')
|
2017-03-19 20:50:58 +00:00
|
|
|
proto_sources = [
|
2017-04-26 14:16:21 +00:00
|
|
|
['gtk-shell', 'stable', ],
|
|
|
|
['gtk-primary-selection', 'stable', ],
|
|
|
|
['pointer-gestures', 'unstable', 'v1', ],
|
|
|
|
['xdg-shell', 'unstable', 'v6', ],
|
|
|
|
['xdg-foreign', 'unstable', 'v1', ],
|
|
|
|
['tablet', 'unstable', 'v2', ],
|
2017-08-02 11:31:30 +00:00
|
|
|
[ 'keyboard-shortcuts-inhibit', 'unstable', 'v1', ],
|
2017-03-19 20:50:58 +00:00
|
|
|
]
|
2016-09-10 18:40:02 +00:00
|
|
|
|
2017-03-20 11:44:42 +00:00
|
|
|
gdk_wayland_gen_headers = []
|
|
|
|
|
2017-04-26 14:16:21 +00:00
|
|
|
foreach p: proto_sources
|
|
|
|
proto_name = p.get(0)
|
|
|
|
proto_stability = p.get(1)
|
|
|
|
|
|
|
|
if proto_stability == 'stable'
|
|
|
|
output_base = proto_name
|
|
|
|
input = 'protocol/@0@.xml'.format(proto_name)
|
|
|
|
else
|
|
|
|
proto_version = p.get(2)
|
|
|
|
output_base = '@0@-@1@-@2@'.format(proto_name, proto_stability, proto_version)
|
|
|
|
input = join_paths(proto_dir, '@0@/@1@/@2@.xml'.format(proto_stability, proto_name, output_base))
|
|
|
|
endif
|
2016-09-10 18:40:02 +00:00
|
|
|
|
2017-03-20 11:44:42 +00:00
|
|
|
gdk_wayland_gen_headers += custom_target('@0@ client header'.format(output_base),
|
2017-04-26 14:16:21 +00:00
|
|
|
input: input,
|
|
|
|
output: '@0@-client-protocol.h'.format(output_base),
|
|
|
|
command: [
|
|
|
|
genprotocols,
|
|
|
|
wayland_scanner,
|
|
|
|
'@INPUT@', '@OUTPUT@',
|
|
|
|
'client-header',
|
|
|
|
])
|
2016-09-10 18:40:02 +00:00
|
|
|
|
2017-03-20 00:36:38 +00:00
|
|
|
gdk_wayland_sources += custom_target('@0@ source'.format(output_base),
|
2017-04-26 14:16:21 +00:00
|
|
|
input: input,
|
|
|
|
output: '@0@-protocol.c'.format(output_base),
|
|
|
|
command: [
|
|
|
|
genprotocols,
|
|
|
|
wayland_scanner,
|
|
|
|
'@INPUT@', '@OUTPUT@',
|
|
|
|
'code',
|
|
|
|
])
|
2017-03-19 20:50:58 +00:00
|
|
|
endforeach
|
2017-03-20 00:37:09 +00:00
|
|
|
|
2017-03-30 23:15:08 +00:00
|
|
|
libgdk_wayland = static_library('gdk-wayland',
|
2017-04-26 14:16:21 +00:00
|
|
|
gdk_wayland_sources, gdk_wayland_gen_headers, gdkconfig, gdkenum_h,
|
|
|
|
include_directories: [ confinc, gdkinc, ],
|
|
|
|
c_args: [
|
|
|
|
'-DGDK_COMPILATION',
|
|
|
|
'-DG_LOG_DOMAIN="Gdk"',
|
2017-04-28 21:26:32 +00:00
|
|
|
] + common_cflags,
|
|
|
|
link_args: common_ldflags,
|
2017-04-26 14:16:21 +00:00
|
|
|
dependencies: [ gdk_deps, gdk_wayland_deps, ])
|