meson: gdk: wayland: generate private wayland headers first

gdkprivate-wayland.h includes generated wayland client protocol
headers and is included from gdkdisplaymanager.c, so we need to
generate those client protocol headers first also when building
main gdk itself.
This commit is contained in:
Tim-Philipp Müller 2017-03-20 11:44:42 +00:00 committed by Emmanuele Bassi
parent 152a25d099
commit cbb6a62496
2 changed files with 11 additions and 3 deletions

View File

@ -179,16 +179,22 @@ if wayland_enabled or broadway_enabled
endif
gdk_backends = []
gdk_backends_gen_headers = [] # non-public generated headers
foreach backend : ['broadway', 'wayland', 'x11', 'mir']
if get_variable('@0@_enabled'.format(backend))
subdir(backend)
gdk_deps += get_variable('gdk_@0@_deps'.format(backend))
gdk_backends += get_variable('libgdk_@0@'.format(backend))
# Special-case this for now to work around Meson bug with get_variable()
# fallback being an empty array, or any array (#1481)
if backend == 'wayland'
gdk_backends_gen_headers += get_variable('gdk_@0@_gen_headers'.format(backend))
endif
endif
endforeach
libgdk = static_library('gdk',
sources: [gdk_sources, gdkconfig],
sources: [gdk_sources, gdk_backends_gen_headers, gdkconfig],
c_args: ['-DGDK_COMPILATION', '-DG_LOG_DOMAIN="Gdk"'],
include_directories: [confinc, xinc, wlinc],
link_with: gdk_backends,

View File

@ -64,12 +64,14 @@ proto_sources = [
join_paths(proto_dir, 'unstable/tablet/tablet-unstable-v2.xml')],
]
gdk_wayland_gen_headers = []
# FIXME: there's some protostability/protoname stuff in Makefile.am I don't grok
foreach p : proto_sources
output_base = p[0]
input = p[1]
gdk_wayland_sources += custom_target('@0@ client header'.format(output_base),
gdk_wayland_gen_headers += custom_target('@0@ client header'.format(output_base),
input : input,
output : '@0@-client-protocol.h'.format(output_base),
command: [genprotocols, wayland_scanner, '@INPUT@', '@OUTPUT@', 'client-header'])
@ -81,7 +83,7 @@ foreach p : proto_sources
endforeach
libgdk_wayland = static_library('libgdk-wayland',
gdk_wayland_sources, gdkconfig, gdkenum_h,
gdk_wayland_sources, gdk_wayland_gen_headers, gdkconfig, gdkenum_h,
include_directories: [confinc, gdkinc],
c_args: ['-DGDK_COMPILATION', '-DG_LOG_DOMAIN="Gdk"'],
dependencies: [gdk_deps, gdk_wayland_deps])