Meson build v2

This commit is contained in:
Timm Bäder 2016-08-21 16:00:37 +02:00 committed by Emmanuele Bassi
parent 7a90e06a3c
commit 5475768d32
10 changed files with 335 additions and 32 deletions

View File

@ -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

View File

@ -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
)

2
demos/meson.build Normal file
View File

@ -0,0 +1,2 @@
subdir('icon-browser')
subdir('widget-factory')

View File

@ -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
)

19
gdk/gdkconfig.h.meson Normal file
View File

@ -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__ */

View File

@ -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 = [
@ -54,7 +58,6 @@ gdk_public_h_sources = [
'gdkpango.h',
'gdkframeclock.h',
'gdkpixbuf.h',
'gdkprivate.h',
'gdkproperty.h',
'gdkrectangle.h',
'gdkrgba.h',
@ -64,9 +67,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',
@ -78,7 +93,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',
@ -103,11 +117,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
@ -139,21 +246,25 @@ 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 = shared_library('gdk',
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],
libgdk_dep = declare_dependency(
sources: ['gdk.h'],
include_directories: [confinc, xinc, wlinc],
dependencies: [
mlib,
shmlib,
xrender_dep,
xi_dep,
xext_dep,
@ -166,5 +277,45 @@ libgdk = shared_library('gdk',
cairogobj_dep,
pango_dep,
cairo_dep,
pixbuf_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, 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,
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
]
)

View File

@ -53,4 +53,5 @@ a11y_sources = files(
'gtktreeviewaccessible.c',
'gtkwidgetaccessible.c',
'gtkwindowaccessible.c',
'gtkstackaccessible.c'
)

View File

@ -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'
)

View File

@ -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',
@ -81,6 +82,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',
@ -124,6 +136,9 @@ gtk_sources = [
'gtkcssshadowsvalue.c',
'gtkcssshadowvalue.c',
'gtkcssshorthandproperty.c',
'gtkshortcutlabel.c',
'gtkfilechoosernativeportal.c',
'gtkdragsource.c',
'gtkcssshorthandpropertyimpl.c',
'gtkcssstaticstyle.c',
'gtkcssstylefuncs.c',
@ -137,8 +152,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',
@ -161,9 +185,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',
@ -179,6 +209,7 @@ gtk_sources = [
'gtkglarea.c',
'gtkgrid.c',
'gtkheaderbar.c',
'gtkdragdest.c',
'gtkhsla.c',
'gtkiconcache.c',
'gtkiconcachevalidator.c',
@ -338,7 +369,8 @@ gtk_sources = [
'gtkwidgetpath.c',
'gtkwindow.c',
'gtkwindowgroup.c',
'gtkwin32theme.c'
'gtkwin32theme.c',
'fallback-c89.c'
]
gtk_unix_sources = [
@ -364,6 +396,9 @@ gtk_x11_sources = [
'gtkmountoperation-x11.c',
]
gtk_wayland_sources = [
'gtkapplication-wayland.c'
]
dnd_sources = [
'gtkclipboard.c',
@ -376,11 +411,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',
@ -388,7 +451,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: [
@ -407,6 +470,8 @@ libgtk = shared_library('gtk',
epoxy_dep,
mlib,
xi_dep,
x11_dep
x11_dep,
libgdk_dep
],
link_with : libgdk)
link_with: libgdk
)

View File

@ -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')