[gtk+/wip/meson: 3/73] Meson build v2



commit 889069a84485d469497d7a45f0345812c3f9b53e
Author: Timm Bäder <mail baedert org>
Date:   Sun Aug 21 16:00:37 2016 +0200

    Meson build v2

 config.h.meson                   |    9 ++
 demos/icon-browser/meson.build   |   22 +++++
 demos/meson.build                |    2 +
 demos/widget-factory/meson.build |   22 +++++
 gdk/gdkconfig.h.meson            |   19 ++++
 gdk/meson.build                  |  179 +++++++++++++++++++++++++++++++++++---
 gtk/a11y/meson.build             |    1 +
 gtk/inspector/meson.build        |    4 +-
 gtk/meson.build                  |   83 ++++++++++++++++--
 meson.build                      |   20 ++++-
 10 files changed, 332 insertions(+), 29 deletions(-)
---
diff --git a/config.h.meson b/config.h.meson
index 8431e04..45527bf 100644
--- a/config.h.meson
+++ b/config.h.meson
@@ -119,6 +119,12 @@
 /* Define to 1 if you have the `sincos' function. */
 #mesondefine HAVE_SINCOS
 
+/* Define to 1 if you have the `log2` function */
+#mesondefine HAVE_LOG2
+
+/* Define to 1 if you ahve the `exp2` function */
+#mesondefine HAVE_EXP2
+
 /* Have the sockaddr_un.sun_len member */
 #mesondefine HAVE_SOCKADDR_UN_SUN_LEN
 
@@ -300,3 +306,6 @@
 
 /* Define to `int' if <sys/types.h> doesn't define. */
 #mesondefine uid_t
+
+/* Define to 1 if linux/memfd.h exists */
+#mesondefine HAVE_LINUX_MEMFD_H
diff --git a/demos/icon-browser/meson.build b/demos/icon-browser/meson.build
new file mode 100644
index 0000000..60ed78f
--- /dev/null
+++ b/demos/icon-browser/meson.build
@@ -0,0 +1,22 @@
+iconbrowser_sources = [
+  'main.c',
+  'iconbrowserapp.c',
+  'iconbrowserwin.c',
+  'iconstore.c'
+]
+
+iconbrowser_resources = gnome.compile_resources(
+  'iconbrowser_resources',
+  'iconbrowser.gresource.xml',
+  source_dir: '.'
+)
+
+iconbrowser = executable(
+  'gtk3-icon-browser',
+  iconbrowser_sources,
+  iconbrowser_resources,
+  dependencies: libgtk_dep,
+  link_with: libgtk,
+  include_directories : confinc,
+  gui_app: true
+)
diff --git a/demos/meson.build b/demos/meson.build
new file mode 100644
index 0000000..eec48fd
--- /dev/null
+++ b/demos/meson.build
@@ -0,0 +1,2 @@
+  subdir('icon-browser')
+  subdir('widget-factory')
diff --git a/demos/widget-factory/meson.build b/demos/widget-factory/meson.build
new file mode 100644
index 0000000..34b998b
--- /dev/null
+++ b/demos/widget-factory/meson.build
@@ -0,0 +1,22 @@
+
+widgetfactory_sources = [
+  'widget-factory.c'
+]
+
+
+
+widgetfactory_resources = gnome.compile_resources(
+  'widgetfactory_resources',
+  'widget-factory.gresource.xml',
+  source_dir: '.'
+)
+
+widget_factory = executable(
+  'gtk3-widget-factory',
+  widgetfactory_sources,
+  widgetfactory_resources,
+  dependencies: libgtk_dep,
+  link_with: libgtk,
+  include_directories : confinc,
+  gui_app: true
+)
diff --git a/gdk/gdkconfig.h.meson b/gdk/gdkconfig.h.meson
new file mode 100644
index 0000000..bb7416e
--- /dev/null
+++ b/gdk/gdkconfig.h.meson
@@ -0,0 +1,19 @@
+#ifndef __GDKCONFIG_H__
+#define __GDKCONFIG_H__
+
+#if !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION)
+#error "Only <gdk/gdk.h> can be included directly."
+#endif
+
+#include <glib.h>
+
+G_BEGIN_DECLS
+
+
+#mesondefine GDK_WINDOWING_X11
+#mesondefine GDK_WINDOWING_BROADWAY
+#mesondefine GDK_WINDOWING_WAYLAND
+
+G_END_DECLS
+
+#endif  /* __GDKCONFIG_H__ */
diff --git a/gdk/meson.build b/gdk/meson.build
index 1fc85fd..c5ab62d 100644
--- a/gdk/meson.build
+++ b/gdk/meson.build
@@ -1,6 +1,5 @@
 deprecated_gdk_sources = ['deprecated/gdkcolor.c']
 gdk_sources = [
-#  'fallback-c89.c',
   'gdk-private.c',
   'gdk.c',
   'gdkapplaunchcontext.c',
@@ -32,6 +31,11 @@ gdk_sources = [
   'gdkvisual.c',
   'gdkwindow.c',
   'gdkwindowimpl.c',
+  'gdkseat.c',
+  'gdkseatdefault.c',
+  'gdkdevicetool.c',
+  'gdkdrawingcontext.c',
+  'gdkmonitor.c'
 ]
 
 gdk_public_h_sources = [
@@ -55,7 +59,6 @@ gdk_public_h_sources = [
   'gdkpango.h',
   'gdkframeclock.h',
   'gdkpixbuf.h',
-  'gdkprivate.h',
   'gdkproperty.h',
   'gdkrectangle.h',
   'gdkrgba.h',
@@ -65,9 +68,21 @@ gdk_public_h_sources = [
   'gdkthreads.h',
   'gdktypes.h',
   'gdkvisual.h',
-  'gdkwindow.h']
+  'gdkwindow.h',
+  'gdkseat.h',
+  'gdkmonitor.h',
+  'gdkdrawingcontext.h',
+  'gdkdevicetool.h'
+]
+
+gdk_private_h_sources = [
+  'gdkseatdefaultprivate.h',
+  'gdkdevicetoolprivate.h',
+  'gdkdrawingcontextprivate.h',
+  'gdkmonitorprivate.h',
+  'gdkprivate.h',
+]
 
-# HACK to get it running.
 gdk_x_sources = [
   'x11/MwmUtil.h',
   'x11/gdkapplaunchcontext-x11.c',
@@ -79,7 +94,6 @@ gdk_x_sources = [
   'x11/gdkdevicemanager-core-x11.c',
   'x11/gdkdevicemanager-x11.c',
   'x11/gdkdevicemanager-xi2.c',
-  'x11/gdkdevicemanagerprivate-core.h',
   'x11/gdkdisplaymanager-x11.c',
   'x11/gdkdisplay-x11.c',
   'x11/gdkdisplay-x11.h',
@@ -104,11 +118,104 @@ gdk_x_sources = [
   'x11/gdkxftdefaults.c',
   'x11/gdkxid.c',
   'x11/gdkx.h',
-  'x11/gdkprivate-x11.h',
   'x11/xsettings-client.h',
   'x11/xsettings-client.c',
+  'x11/gdkmonitor-x11.c',
+  'x11/gdkmonitor-x11.h',
+  'x11/gdkx11monitor.h'
+]
+
+gdk_x_private_sources = [
+  'x11/gdkprivate-x11.h',
+  'x11/gdkdevicemanagerprivate-core.h',
+]
+
+gdk_wayland_sources = [
+  'wayland/gdkapplaunchcontext-wayland.c',
+  'wayland/gdkcursor-wayland.c',
+  'wayland/gdkdevice-wayland.c',
+  'wayland/gdkdisplay-wayland.c',
+  'wayland/gdkdisplay-wayland.h',
+  'wayland/gdkdnd-wayland.c',
+  'wayland/gdkeventsource.c',
+  'wayland/gdkglcontext-wayland.c',
+  'wayland/gdkglcontext-wayland.h',
+  'wayland/gdkkeys-wayland.c',
+  'wayland/gdkmonitor-wayland.c',
+  'wayland/gdkmonitor-wayland.h',
+  'wayland/gdkscreen-wayland.c',
+  'wayland/gdkseat-wayland.h',
+  'wayland/gdkselection-wayland.c',
+  'wayland/gdkwaylanddevice.h',
+  'wayland/gdkwaylanddisplay.h',
+  'wayland/gdkwaylandglcontext.h',
+  'wayland/gdkwayland.h',
+  'wayland/gdkwaylandmonitor.h',
+  'wayland/gdkwaylandselection.h',
+  'wayland/gdkwaylandwindow.h',
+  'wayland/gdkwindow-wayland.c',
+  'wayland/wm-button-layout-translation.c',
+  'wayland/gtk-primary-selection-protocol.c',
+  'wayland/gtk-shell-protocol.c',
+  'wayland/xdg-shell-unstable-v5-protocol.c',
+  'wayland/pointer-gestures-unstable-v1-protocol.c',
+  'wayland/tablet-unstable-v2-protocol.c',
+]
+
+gdk_wayland_private_sources = [
+  'wayland/gdkprivate-wayland.h',
+]
+
+
+
+gdk_broadway_sources = [
+  'broadway/gdkdisplay-broadway.c',
+  'broadway/gdkdisplay-broadway.h',
+  'broadway/gdkscreen-broadway.c',
+  'broadway/gdkscreen-broadway.h',
+  'broadway/broadway-output.c',
+  'broadway/broadway-output.h',
+  'broadway/broadway-server.h',
+  'broadway/broadway-server.c',
+  'broadway/gdkbroadway-server.c',
+  'broadway/gdkcursor-broadway.c',
+  'broadway/gdkvisual-broadway.c',
+  'broadway/gdkselection-broadway.c',
+  'broadway/gdkwindow-broadway.c',
+  'broadway/gdkwindow-broadway.h',
+  'broadway/gdkmonitor-broadway.c',
+  'broadway/gdkmonitor-broadway.h',
+  'broadway/gdkkeys-broadway.c',
+  'broadway/gdkglobals-broadway.c',
+  'broadway/gdkeventsource.c',
+  'broadway/gdkeventsource.h',
+  'broadway/gdkdnd-broadway.c',
+  'broadway/broadwayd.c',
+  'broadway/gdkdevicemanager-broadway.c',
+  'broadway/gdkdevicemanager-broadway.h',
+  'broadway/gdkdevice-broadway.c',
+  'broadway/gdkdevice-broadway.h',
+  'broadway/broadway-buffer.c',
+  'broadway/broadway-buffer.h',
+  'broadway/gdktestutils-broadway.c',
+  'broadway/gdkproperty-broadway.c'
+]
+
+gdk_broadway_private_sources = [
+  'broadway/gdkprivate-broadway.h'
 ]
 
+
+
+gdkresources = gnome.compile_resources(
+  'gdkresources',
+  'gdk.gresource.xml',
+  source_dir: '.',
+  c_name: '_gdk',
+  extra_args: '--manual-register'
+)
+
+
 deprecated_h_sources = ['deprecated/gdkcolor.h']
 
 gdk_headers = gdk_public_h_sources + deprecated_h_sources
@@ -140,21 +247,59 @@ gdkmarshal_c = custom_target('gdkmarshal_c',
   input : 'gdkmarshalers.list',
   command : [mkmarshal, glib_marshal, '@INPUT@', '@OUTPUT@'])
 
-configure_file(input : 'gdkconfig.h.in',
+
+cdata = configuration_data()
+cdata.set('GDK_WINDOWING_X11', 1)
+cdata.set('GDK_WINDOWING_WAYLAND', 1)
+cdata.set('GDK_WINDOWING_BROADWAY', 1)
+gdkconfig = configure_file(input : 'gdkconfig.h.meson',
   output : 'gdkconfig.h',
-  configuration : configuration_data())
+  configuration : cdata
+)
 
 xinc = include_directories('x11')
+wlinc = include_directories('wayland')
+
+libgdk_dep = declare_dependency(
+  sources: ['gdk.h'],
+  include_directories: [confinc, xinc, wlinc],
+  dependencies: [
+    mlib,
+    shmlib,
+    xrender_dep,
+    xi_dep,
+    xext_dep,
+    x11_dep,
+    fontconfig_dep,
+    epoxy_dep,
+    giounix_dep,
+    glib_dep,
+    pangocairo_dep,
+    cairogobj_dep,
+    pango_dep,
+    cairo_dep,
+    pixbuf_dep,
+    xkbdep,
+    wlclientdep,
+    wlprotocolsdep,
+    wlcursordep,
+    wlegldep
+  ]
+)
 
 libgdk = shared_library('gdk',
+  gdkconfig,
   gdk_sources, deprecated_gdk_sources,
   gdkenum_c, gdkenum_h,
-  gdkmarshal_h, gdkmarshal_c,
-  gdk_x_sources,
-  c_args: ['-DHAVE_CONFIG_H', '-DGDK_COMPILATION', '-DGDK_WINDOWING_X11'],
-  include_directories: [confinc, xinc],
+  gdkmarshal_h, gdkmarshal_c, gdkresources,
+  gdk_x_sources, gdk_x_private_sources,
+  gdk_wayland_sources, gdk_wayland_private_sources,
+  gdk_broadway_sources, gdk_broadway_private_sources,
+  c_args: ['-DHAVE_CONFIG_H', '-DGDK_COMPILATION'],
+  include_directories: [confinc, xinc, wlinc],
   dependencies: [
     mlib,
+    shmlib,
     xrender_dep,
     xi_dep,
     xext_dep,
@@ -167,5 +312,11 @@ libgdk = shared_library('gdk',
     cairogobj_dep,
     pango_dep,
     cairo_dep,
-    pixbuf_dep
-  ])
+    pixbuf_dep,
+    xkbdep,
+    wlclientdep,
+    wlprotocolsdep,
+    wlcursordep,
+    wlegldep
+  ]
+)
diff --git a/gtk/a11y/meson.build b/gtk/a11y/meson.build
index f9b80d0..c53c22a 100644
--- a/gtk/a11y/meson.build
+++ b/gtk/a11y/meson.build
@@ -53,4 +53,5 @@ a11y_sources = files(
   'gtktreeviewaccessible.c',
   'gtkwidgetaccessible.c',
   'gtkwindowaccessible.c',
+  'gtkstackaccessible.c'
   )
diff --git a/gtk/inspector/meson.build b/gtk/inspector/meson.build
index 0647b65..a119a08 100644
--- a/gtk/inspector/meson.build
+++ b/gtk/inspector/meson.build
@@ -2,7 +2,6 @@ inspector_sources = files(
   'action-editor.c',
   'actions.c',
   'cellrenderergraph.c',
-  'classes-list.c',
   'css-editor.c',
   'css-node-tree.c',
   'data-list.c',
@@ -24,8 +23,9 @@ inspector_sources = files(
   'signals-list.c',
   'size-groups.c',
   'statistics.c',
-  'style-prop-list.c',
   'treewalk.c',
   'visual.c',
   'window.c',
+  'strv-editor.c',
+  'gtkstackcombo.c'
 )
diff --git a/gtk/meson.build b/gtk/meson.build
index 48202d2..d15ac76 100644
--- a/gtk/meson.build
+++ b/gtk/meson.build
@@ -1,7 +1,3 @@
-#  '$(a11y_c_sources)\
-#  '$(deprecated_c_sources)\
-#  '$(inspector_c_sources)\
-
 subdir('deprecated')
 subdir('a11y')
 subdir('inspector')
@@ -44,10 +40,15 @@ gtk_sources = [
   'gtkbox.c',
   'gtkbuildable.c',
   'gtkbuilder.c',
+  'gtkicon.c',
+  'gtkshortcutswindow.c',
+  'gtkshortcutssection.c',
   'gtkbuilderparser.c',
   'gtkbuilder-menus.c',
   'gtkbutton.c',
   'gtkcairoblur.c',
+  'gtkcssnode.c',
+  'gtkcsscalcvalue.c',
   'gtkcalendar.c',
   'gtkcellarea.c',
   'gtkcellareabox.c',
@@ -80,6 +81,17 @@ gtk_sources = [
   'gtkcomboboxtext.c',
   'gtkcontainer.c',
   'gtkcssanimation.c',
+  'gtkcssgadget.c',
+  'gtkcsscustomgadget.c',
+  'gtkboxgadget.c',
+  'gtkimagedefinition.c',
+  'gtkprogresstracker.c',
+  'gtkcssimageradial.c',
+  'gtkcssimagerecolor.c',
+  'gtkcssimagefallback.c',
+  'gtkbuiltinicon.c',
+  'gtkcssstylechange.c',
+  'gtkcsspalettevalue.c',
   'gtkcssanimatedstyle.c',
   'gtkcssarrayvalue.c',
   'gtkcssbgsizevalue.c',
@@ -123,6 +135,9 @@ gtk_sources = [
   'gtkcssshadowsvalue.c',
   'gtkcssshadowvalue.c',
   'gtkcssshorthandproperty.c',
+  'gtkshortcutlabel.c',
+  'gtkfilechoosernativeportal.c',
+  'gtkdragsource.c',
   'gtkcssshorthandpropertyimpl.c',
   'gtkcssstaticstyle.c',
   'gtkcssstylefuncs.c',
@@ -136,8 +151,17 @@ gtk_sources = [
   'gtkcsstypes.c',
   'gtkcssvalue.c',
   'gtkcsswidgetnode.c',
+  'gtkcssnodestylecache.c',
+  'gtkapplicationaccels.c',
+  'gtkcssdimensionvalue.c',
+  'gtkshortcutsgroup.c',
+  'gtkshortcutsshortcut.c',
+  'gtkfilechoosernative.c',
+  'gtknativedialog.c',
   'gtkdialog.c',
   'gtkdrawingarea.c',
+  'gtkutils.c',
+  'gtktooltipwindow.c',
   'gtkeditable.c',
   'gtkentry.c',
   'gtkentrybuffer.c',
@@ -160,9 +184,15 @@ gtk_sources = [
   'gtkfontbutton.c',
   'gtkfontchooser.c',
   'gtkfontchooserdialog.c',
+  'gtkcsswin32sizevalue.c',
   'gtkfontchooserutils.c',
+  'gtkwin32theme.c',
+  'gtkwin32draw.c',
+  'gtkcomposetable.c',
+  'gdkpixbufutils.c',
   'gtkfontchooserwidget.c',
   'gtkframe.c',
+  'gtkprintoperation-portal.c',
   'gtkgladecatalog.c',
   'gtkgesture.c',
   'gtkgesturedrag.c',
@@ -176,6 +206,7 @@ gtk_sources = [
   'gtkglarea.c',
   'gtkgrid.c',
   'gtkheaderbar.c',
+  'gtkdragdest.c',
   'gtkhsla.c',
   'gtkiconcache.c',
   'gtkiconcachevalidator.c',
@@ -334,7 +365,8 @@ gtk_sources = [
   'gtkwidgetpath.c',
   'gtkwindow.c',
   'gtkwindowgroup.c',
-  'gtkwin32theme.c'
+  'gtkwin32theme.c',
+  'fallback-c89.c'
 ]
 
 gtk_unix_sources = [
@@ -360,6 +392,9 @@ gtk_x11_sources = [
   'gtkmountoperation-x11.c',
 ]
 
+gtk_wayland_sources = [
+  'gtkapplication-wayland.c'
+]
 
 dnd_sources = [
   'gtkclipboard.c',
@@ -372,11 +407,39 @@ gtk_dbus_src = gnome.gdbus_codegen('gtkdbusgenerated', 'gtkdbusinterfaces.xml',
                                    interface_prefix: 'org.Gtk.',
                                    namespace: '_Gtk')
 
+libgtk_dep = declare_dependency(
+  link_with: libgdk,
+  sources: [
+    'gtk.h'
+  ],
+  dependencies: [
+    gmodule_dep,
+    giounix_dep,
+    glib_dep,
+    atkbridge_dep,
+    pangocairo_dep,
+    pangoft_dep,
+    pango_dep,
+    cairogobj_dep,
+    cairo_dep,
+    fontconfig_dep,
+    pixbuf_dep,
+    atk_dep,
+    epoxy_dep,
+    mlib,
+    xi_dep,
+    x11_dep,
+    libgdk_dep
+  ],
+  include_directories: confinc
+)
+
+
 libgtk = shared_library('gtk',
   gtk_sources, gtk_dbus_src, gtk_unix_sources,
   gtk_deprecated_c_sources, dnd_sources,
   inspector_sources, a11y_sources,
-  gtk_x11_sources,
+  gtk_x11_sources, gtk_wayland_sources,
   gtk_use_wayland_or_x11_c_sources,
   c_args: [
     '-DGTK_COMPILATION', '-DGTK_PRINT_BACKEND_ENABLE_UNSUPPORTED',
@@ -384,7 +447,7 @@ libgtk = shared_library('gtk',
     '-DGTK_LIBDIR="libdir"', '-DGTK_SYSCONFDIR="sysconfdir"',
     '-DGTK_LOCALEDIR="localedir"', '-DGTK_DATA_PREFIX="dataprefix"',
     '-DGTK_PRINT_BACKENDS="null"', '-DGTK_VERSION="3"',
-    '-DGDK_WINDOWING_X11'
+    '-DX11_DATA_PREFIX="/share/x11/locale"'
   ],
   include_directories: [ confinc, gdkinc ],
   dependencies: [
@@ -403,6 +466,8 @@ libgtk = shared_library('gtk',
     epoxy_dep,
     mlib,
     xi_dep,
-    x11_dep
+    x11_dep,
+    libgdk_dep
   ],
-  link_with : libgdk)
+  link_with: libgdk
+)
diff --git a/meson.build b/meson.build
index 29411bc..9434189 100644
--- a/meson.build
+++ b/meson.build
@@ -7,16 +7,21 @@ project('gtk+-3.0', 'c',
         ],
         license: 'LGPLv2.1+')
 
+gnome = import('gnome')
+
+add_global_arguments('-DG_LOG_USE_STRUCTURED=1', language: 'c')
+
 gtk_version = meson.project_version().split('.')
 gtk_major_version = gtk_version[0]
 gtk_minor_version = gtk_version[1]
 gtk_micro_version = gtk_version[2]
 
 gtk_binary_age = 100 * gtk_minor_version.to_int() + gtk_micro_version.to_int()
-gtk_api_version = '@0@'.0'.format(gtk_major_version)
+gtk_api_version = '@0@.0'.format(gtk_major_version)
 
 cc = meson.get_compiler('c')
 cdata = configuration_data()
+cdata.set('PACKAGE_VERSION', '"'+meson.project_version()+'"')
 check_headers = [
   ['HAVE_CRT_EXTERNS_H', 'crt/externs.h'],
   ['HAVE_DLFCN_H', 'dlfcn.h'],
@@ -36,6 +41,7 @@ check_headers = [
   ['HAVE_SYS_TIME_H', 'sys/time.h'],
   ['HAVE_SYS_TYPES_H', 'sys/types.h'],
   ['HAVE_UNISTD_H', 'unistd.h'],
+  ['HAVE_LINUX_MEMFD_H', 'linux/memfd.h']
 ]
 
 foreach h : check_headers
@@ -73,6 +79,8 @@ check_functions = [
 # check token HAVE_RANDR15
   ['HAVE_ROUND', 'round', '#include<math.h>'],
   ['HAVE_RINT', 'rint', '#include<math.h>'],
+  ['HAVE_LOG2', 'log2', '#include<math.h>'],
+  ['HAVE_EXP2', 'exp2', '#include<math.h>'],
 # check token HAVE_SINCOS
 # check token HAVE_SOCKADDR_UN_SUN_LEN
 # check token HAVE_SOLARIS_XINERAMA
@@ -123,7 +131,13 @@ atk_dep = dependency('atk')
 atkbridge_dep = dependency('atk-bridge-2.0')
 gmodule_dep = dependency('gmodule-2.0')
 mlib = cc.find_library('m')
+shmlib = cc.find_library('rt')
 fontconfig_dep = dependency('fontconfig')
+xkbdep = dependency('xkbcommon')
+wlclientdep = dependency('wayland-client')
+wlprotocolsdep = dependency('wayland-protocols')
+wlcursordep = dependency('wayland-cursor')
+wlegldep = dependency('wayland-egl')
 
 if giounix_dep.found()
   cdata.set('HAVE_GIO_UNIX', 1)
@@ -131,8 +145,6 @@ endif
 
 configure_file(input: 'config.h.meson', output: 'config.h', configuration: cdata)
 
-gnome = import('gnome')
-
 subdir('gdk')
 subdir('gtk')
-subdir('examples')
+subdir('demos')


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