From 152a25d09915602082022368edc1fb6190baebb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Mon, 20 Mar 2017 11:44:04 +0000 Subject: [PATCH] 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(-) create mode 100644 gdk/mir/meson.build diff --git a/gdk/gdkconfig.h.meson b/gdk/gdkconfig.h.meson index db09844f26..f832c043de 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 56a5fcc702..5b91e8a1df 100644 --- a/gdk/meson.build +++ b/gdk/meson.build @@ -117,6 +117,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( @@ -178,7 +179,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 0000000000..5c11162d95 --- /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 62d76475fc..2cea034fc2 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 ec04443638..fe71ac39da 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')