[gtk+/wip/meson: 76/136] meson: gdk: wayland: generate private wayland headers first



commit 28b2f1d5235f2c82c305c82a5f86f96ad6e89e40
Author: Tim-Philipp Müller <tim centricular com>
Date:   Mon Mar 20 11:44:42 2017 +0000

    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.

 gdk/meson.build         |    8 +++++++-
 gdk/wayland/meson.build |    6 ++++--
 2 files changed, 11 insertions(+), 3 deletions(-)
---
diff --git a/gdk/meson.build b/gdk/meson.build
index adad6bd..8f32f38 100644
--- a/gdk/meson.build
+++ b/gdk/meson.build
@@ -180,16 +180,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,
diff --git a/gdk/wayland/meson.build b/gdk/wayland/meson.build
index d1a96b6..b0d20ec 100644
--- a/gdk/wayland/meson.build
+++ b/gdk/wayland/meson.build
@@ -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])


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]