| 1 |
gdk_wayland_sources = files( |
| 2 |
'gdkapplaunchcontext-wayland.c', |
| 3 |
'gdkcursor-wayland.c', |
| 4 |
'gdkdevice-wayland.c', |
| 5 |
'gdkdisplay-wayland.c', |
| 6 |
'gdkdnd-wayland.c', |
| 7 |
'gdkeventsource.c', |
| 8 |
'gdkkeys-wayland.c', |
| 9 |
'gdkglcontext-wayland.c', |
| 10 |
'gdkmonitor-wayland.c', |
| 11 |
'gdkscreen-wayland.c', |
| 12 |
'gdkselection-wayland.c', |
| 13 |
'gdkwindow-wayland.c', |
| 14 |
'wm-button-layout-translation.c', |
| 15 |
) |
| 16 |
|
| 17 |
gdk_wayland_public_headers = files( |
| 18 |
'gdkwaylanddevice.h', |
| 19 |
'gdkwaylanddisplay.h', |
| 20 |
'gdkwaylandglcontext.h', |
| 21 |
'gdkwaylandmonitor.h', |
| 22 |
'gdkwaylandselection.h', |
| 23 |
'gdkwaylandwindow.h', |
| 24 |
) |
| 25 |
|
| 26 |
install_headers(gdk_wayland_public_headers, subdir: 'gtk-3.0/gdk/wayland') |
| 27 |
install_headers('gdkwayland.h', subdir: 'gtk-3.0/gdk') |
| 28 |
|
| 29 |
gdk_wayland_deps = [ |
| 30 |
shmlib, |
| 31 |
xkbdep, |
| 32 |
wlclientdep, |
| 33 |
wlprotocolsdep, |
| 34 |
wlcursordep, |
| 35 |
wlegldep, |
| 36 |
] |
| 37 |
|
| 38 |
# wayland protocols |
| 39 |
wlprotocolsdep = dependency('wayland-protocols') |
| 40 |
proto_dir = wlprotocolsdep.get_variable(pkgconfig: 'pkgdatadir') |
| 41 |
assert(proto_dir != '', 'Could not get pkgdatadir from wayland-protocols.pc') |
| 42 |
|
| 43 |
wayland_scanner = find_program('wayland-scanner') |
| 44 |
|
| 45 |
# Format: |
| 46 |
# - protocol name |
| 47 |
# - protocol stability ('private', 'stable' or 'unstable') |
| 48 |
# - protocol version (if stability is 'unstable') |
| 49 |
proto_sources = [ |
| 50 |
['gtk-shell', 'private', ], |
| 51 |
['gtk-primary-selection', 'private', ], |
| 52 |
['pointer-gestures', 'unstable', 'v1', ], |
| 53 |
['xdg-shell', 'unstable', 'v6', ], |
| 54 |
['xdg-shell', 'stable', ], |
| 55 |
['xdg-foreign', 'unstable', 'v1', ], |
| 56 |
['xdg-foreign', 'unstable', 'v2', ], |
| 57 |
['tablet', 'unstable', 'v2', ], |
| 58 |
['keyboard-shortcuts-inhibit', 'unstable', 'v1', ], |
| 59 |
['server-decoration', 'private' ], |
| 60 |
['xdg-output', 'unstable', 'v1', ], |
| 61 |
['primary-selection', 'unstable', 'v1', ], |
| 62 |
['cursor-shape-v1', 'private', ], |
| 63 |
] |
| 64 |
if wlprotocolsdep.version().version_compare('>=1.21') |
| 65 |
proto_sources += [['xdg-activation', 'staging', 'v1', ]] |
| 66 |
endif |
| 67 |
|
| 68 |
gdk_wayland_gen_headers = [] |
| 69 |
|
| 70 |
foreach p: proto_sources |
| 71 |
proto_name = p.get(0) |
| 72 |
proto_stability = p.get(1) |
| 73 |
|
| 74 |
if proto_stability == 'stable' |
| 75 |
output_base = proto_name |
| 76 |
input = join_paths(proto_dir, '@0@/@1@/@[email protected]'.format(proto_stability, proto_name, output_base)) |
| 77 |
elif proto_stability == 'staging' |
| 78 |
proto_version = p.get(2) |
| 79 |
output_base = '@0@-@1@'.format(proto_name, proto_version) |
| 80 |
input = join_paths(proto_dir, '@0@/@1@/@[email protected]'.format(proto_stability, proto_name, output_base)) |
| 81 |
elif proto_stability == 'private' |
| 82 |
output_base = proto_name |
| 83 |
input = 'protocol/@[email protected]'.format(proto_name) |
| 84 |
else |
| 85 |
proto_version = p.get(2) |
| 86 |
output_base = '@0@-@1@-@2@'.format(proto_name, proto_stability, proto_version) |
| 87 |
input = join_paths(proto_dir, '@0@/@1@/@[email protected]'.format(proto_stability, proto_name, output_base)) |
| 88 |
endif |
| 89 |
|
| 90 |
gdk_wayland_gen_headers += custom_target('@0@ client header'.format(output_base), |
| 91 |
input: input, |
| 92 |
output: '@[email protected]'.format(output_base), |
| 93 |
command: [ |
| 94 |
wayland_scanner, |
| 95 |
'client-header', |
| 96 |
'@INPUT@', '@OUTPUT@', |
| 97 |
]) |
| 98 |
|
| 99 |
gdk_wayland_sources += custom_target('@0@ source'.format(output_base), |
| 100 |
input: input, |
| 101 |
output: '@[email protected]'.format(output_base), |
| 102 |
command: [ |
| 103 |
wayland_scanner, |
| 104 |
'private-code', |
| 105 |
'@INPUT@', '@OUTPUT@', |
| 106 |
]) |
| 107 |
endforeach |
| 108 |
|
| 109 |
libgdk_wayland = static_library('gdk-wayland', |
| 110 |
gdk_wayland_sources, gdk_wayland_gen_headers, gdkconfig, gdkenum_h, |
| 111 |
include_directories: [ confinc, gdkinc, ], |
| 112 |
c_args: [ |
| 113 |
'-DGDK_COMPILATION', |
| 114 |
'-DG_LOG_DOMAIN="Gdk"', |
| 115 |
] + common_cflags, |
| 116 |
link_args: common_ldflags, |
| 117 |
dependencies: [ gdk_deps, gdk_wayland_deps, ]) |