[gtk+/wip/meson: 62/73] meson: gdk: add Mir backend bits



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

    meson: gdk: add Mir backend bits
    
    Completely untested, might not even build.

 gdk/gdkconfig.h.meson |    1 +
 gdk/meson.build       |    3 ++-
 gdk/mir/meson.build   |   31 +++++++++++++++++++++++++++++++
 meson.build           |    8 +++++++-
 meson_options.txt     |   14 ++++++++++----
 5 files changed, 51 insertions(+), 6 deletions(-)
---
diff --git a/gdk/gdkconfig.h.meson b/gdk/gdkconfig.h.meson
index db09844..f832c04 100644
--- a/gdk/gdkconfig.h.meson
+++ b/gdk/gdkconfig.h.meson
@@ -13,6 +13,7 @@ G_BEGIN_DECLS
 #mesondefine GDK_WINDOWING_X11
 #mesondefine GDK_WINDOWING_BROADWAY
 #mesondefine GDK_WINDOWING_WAYLAND
+#mesondefine GDK_WINDOWING_MIR
 
 #mesondefine GDK_RENDERING_VULKAN
 
diff --git a/gdk/meson.build b/gdk/meson.build
index 8e8b0ad..adad6bd 100644
--- a/gdk/meson.build
+++ b/gdk/meson.build
@@ -118,6 +118,7 @@ gdkconfig_cdata = configuration_data()
 gdkconfig_cdata.set('GDK_WINDOWING_X11', x11_enabled)
 gdkconfig_cdata.set('GDK_WINDOWING_WAYLAND', wayland_enabled)
 gdkconfig_cdata.set('GDK_WINDOWING_BROADWAY', broadway_enabled)
+gdkconfig_cdata.set('GDK_WINDOWING_MIR', mir_enabled)
 gdkconfig_cdata.set('GDK_RENDERING_VULKAN', have_vulkan)
 
 gdkconfig = configure_file(
@@ -179,7 +180,7 @@ if wayland_enabled or broadway_enabled
 endif
 
 gdk_backends = []
-foreach backend : ['broadway', 'wayland', 'x11']
+foreach backend : ['broadway', 'wayland', 'x11', 'mir']
   if get_variable('@0@_enabled'.format(backend))
     subdir(backend)
     gdk_deps += get_variable('gdk_@0@_deps'.format(backend))
diff --git a/gdk/mir/meson.build b/gdk/mir/meson.build
new file mode 100644
index 0000000..5c11162
--- /dev/null
+++ b/gdk/mir/meson.build
@@ -0,0 +1,31 @@
+gdk_mir_sources = files([
+  'gdkmircursor.c',
+  'gdkmirdevicemanager.c',
+  'gdkmirdisplay.c',
+  'gdkmireventsource.c',
+  'gdkmirglcontext.c',
+  'gdkmirkeyboard.c',
+  'gdkmirkeymap.c',
+  'gdkmirpointer.c',
+  'gdkmirscreen.c',
+  'gdkmirwindow.c',
+  'gdkmirwindowimpl.c',
+  'gdkmir-debug.c',
+])
+
+#gdk_mir_public_headers = []
+#install_headers(gdk_mir_public_headers, subdir: 'gtk-4.0/gdk/mir/')
+
+install_headers('gdkmir.h', subdir: 'gtk-4.0/gdk/')
+
+gdk_mir_deps = [
+  mirclient_dep,
+  mircookie_dep,
+  libcontent_hub_glib_dep,
+]
+
+libgdk_mir = static_library('libgdk-mir',
+  gdk_mir_sources, gdkconfig, gdkenum_h,
+  include_directories: [confinc, gdkinc],
+  c_args: ['-DGDK_COMPILATION', '-DG_LOG_DOMAIN="Gdk"'],
+  dependencies: [gdk_deps, gdk_mir_deps])
diff --git a/meson.build b/meson.build
index 62d7647..2cea034 100644
--- a/meson.build
+++ b/meson.build
@@ -36,7 +36,7 @@ gtk_api_version = '@0@.0'.format(gtk_major_version)
 x11_enabled      = get_option('enable-x11-backend')
 wayland_enabled  = get_option('enable-wayland-backend')
 broadway_enabled = get_option('enable-broadway-backend')
-
+mir_enabled      = get_option('enable-mir-backend')
 
 mkmarshal    = find_program('build_marshal.py')
 glib_marshal = find_program('glib-genmarshal')
@@ -256,6 +256,12 @@ if x11_enabled
   endif
 endif
 
+if mir_enabled
+  mirclient_dep = dependency('mirclient', version : '>= 0.22.0')
+  mircookie_dep = dependency('mircookie', version : '>= 0.17.0')
+  libcontent_hub_glib_dep = dependency('libcontenthub-glib')
+endif
+
 mlib = cc.find_library('m', required: false)
 
 if giounix_dep.found()
diff --git a/meson_options.txt b/meson_options.txt
index ec04443..fe71ac3 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -1,4 +1,10 @@
-option('enable-x11-backend', type: 'boolean', value: 'true')
-option('enable-wayland-backend', type: 'boolean', value: 'true')
-option('enable-broadway-backend', type: 'boolean', value: 'false')
-option('enable-vulkan', type: 'combo', choices : ['yes', 'no', 'auto'], value : 'auto')
+option('enable-x11-backend', type: 'boolean', value: 'true',
+  description : 'Enable the X11 gdk backend')
+option('enable-wayland-backend', type: 'boolean', value: 'true',
+  description : 'Enable the wayland gdk backend')
+option('enable-broadway-backend', type: 'boolean', value: 'false',
+  description : 'Enable the broadway (HTML5) gdk backend')
+option('enable-mir-backend', type: 'boolean', value: 'false',
+  description : 'Enable the Mir gdk backend (UNTESTED, NEEDS WORK)')
+option('enable-vulkan', type: 'combo', choices : ['yes', 'no', 'auto'], value : 'auto',
+  description : 'Enable support for the Vulkan graphics API')


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