2018-11-19 20:07:09 +00:00
|
|
|
deprecated_gdk_sources = files('deprecated/gdkcolor.c')
|
|
|
|
gdk_sources = files(
|
2018-11-13 05:29:03 +00:00
|
|
|
'gdk-private.c',
|
|
|
|
'gdk.c',
|
|
|
|
'gdkapplaunchcontext.c',
|
|
|
|
'gdkcairo.c',
|
|
|
|
'gdkcursor.c',
|
|
|
|
'gdkdeprecated.c',
|
|
|
|
'gdkdevice.c',
|
|
|
|
'gdkdevicemanager.c',
|
|
|
|
'gdkdevicepad.c',
|
|
|
|
'gdkdisplay.c',
|
|
|
|
'gdkdisplaymanager.c',
|
|
|
|
'gdkdnd.c',
|
|
|
|
'gdkevents.c',
|
|
|
|
'gdkframetimings.c',
|
|
|
|
'gdkgl.c',
|
|
|
|
'gdkglcontext.c',
|
|
|
|
'gdkglobals.c',
|
|
|
|
'gdkkeys.c',
|
|
|
|
'gdkkeyuni.c',
|
|
|
|
'gdkoffscreenwindow.c',
|
|
|
|
'gdkframeclock.c',
|
|
|
|
'gdkframeclockidle.c',
|
|
|
|
'gdkpango.c',
|
|
|
|
'gdkpixbuf-drawable.c',
|
2019-06-06 23:19:36 +00:00
|
|
|
'gdkprofiler.c',
|
2018-11-13 05:29:03 +00:00
|
|
|
'gdkproperty.c',
|
|
|
|
'gdkrectangle.c',
|
|
|
|
'gdkrgba.c',
|
|
|
|
'gdkscreen.c',
|
|
|
|
'gdkselection.c',
|
|
|
|
'gdkvisual.c',
|
|
|
|
'gdkwindow.c',
|
|
|
|
'gdkwindowimpl.c',
|
|
|
|
'gdkseat.c',
|
|
|
|
'gdkseatdefault.c',
|
|
|
|
'gdkdevicetool.c',
|
|
|
|
'gdkdrawingcontext.c',
|
|
|
|
'gdkmonitor.c'
|
2018-11-19 20:07:09 +00:00
|
|
|
)
|
2018-11-13 05:29:03 +00:00
|
|
|
|
2018-12-03 13:09:41 +00:00
|
|
|
gdk_gir_public_headers = files(
|
2018-11-13 05:29:03 +00:00
|
|
|
'gdk.h',
|
|
|
|
'gdk-autocleanup.h',
|
|
|
|
'gdkapplaunchcontext.h',
|
|
|
|
'gdkcairo.h',
|
|
|
|
'gdkcursor.h',
|
|
|
|
'gdkdevice.h',
|
|
|
|
'gdkdevicetool.h',
|
|
|
|
'gdkdevicemanager.h',
|
|
|
|
'gdkdevicepad.h',
|
|
|
|
'gdkdisplay.h',
|
|
|
|
'gdkdisplaymanager.h',
|
|
|
|
'gdkdnd.h',
|
|
|
|
'gdkdrawingcontext.h',
|
|
|
|
'gdkevents.h',
|
|
|
|
'gdkframetimings.h',
|
|
|
|
'gdkglcontext.h',
|
|
|
|
'gdkkeys.h',
|
|
|
|
'gdkkeysyms.h',
|
|
|
|
'gdkmain.h',
|
|
|
|
'gdkmonitor.h',
|
|
|
|
'gdkpango.h',
|
|
|
|
'gdkframeclock.h',
|
|
|
|
'gdkpixbuf.h',
|
|
|
|
'gdkprivate.h',
|
|
|
|
'gdkproperty.h',
|
|
|
|
'gdkrectangle.h',
|
|
|
|
'gdkrgba.h',
|
|
|
|
'gdkscreen.h',
|
|
|
|
'gdkseat.h',
|
|
|
|
'gdkselection.h',
|
|
|
|
'gdktestutils.h',
|
|
|
|
'gdkthreads.h',
|
|
|
|
'gdktypes.h',
|
|
|
|
'gdkvisual.h',
|
|
|
|
'gdkwindow.h',
|
2018-11-19 20:07:09 +00:00
|
|
|
)
|
2018-12-03 13:09:41 +00:00
|
|
|
gdk_nogir_public_headers = [files('gdkkeysyms-compat.h')]
|
|
|
|
gdk_public_headers = gdk_gir_public_headers + gdk_nogir_public_headers
|
2018-11-19 20:07:09 +00:00
|
|
|
install_headers(gdk_public_headers, subdir : 'gtk-3.0/gdk')
|
|
|
|
|
|
|
|
deprecated_h_sources = files('deprecated/gdkcolor.h')
|
|
|
|
install_headers(deprecated_h_sources, subdir : 'gtk-3.0/gdk/deprecated')
|
2018-11-13 05:29:03 +00:00
|
|
|
|
2018-11-19 20:07:09 +00:00
|
|
|
# This variable is unused, but added just for completeness
|
|
|
|
gdk_private_headers = files(
|
2018-11-13 05:29:03 +00:00
|
|
|
'gdkseatdefaultprivate.h',
|
|
|
|
'gdkdevicetoolprivate.h',
|
|
|
|
'gdkdrawingcontextprivate.h',
|
|
|
|
'gdkmonitorprivate.h',
|
|
|
|
'gdkprivate.h',
|
2018-11-19 20:07:09 +00:00
|
|
|
)
|
2018-11-13 05:29:03 +00:00
|
|
|
|
2018-11-19 20:07:09 +00:00
|
|
|
gdk_wayland_sources = files(
|
2018-11-13 05:29:03 +00:00
|
|
|
'wayland/gdkapplaunchcontext-wayland.c',
|
|
|
|
'wayland/gdkcursor-wayland.c',
|
|
|
|
'wayland/gdkdevice-wayland.c',
|
|
|
|
'wayland/gdkdisplay-wayland.c',
|
|
|
|
'wayland/gdkdnd-wayland.c',
|
|
|
|
'wayland/gdkeventsource.c',
|
|
|
|
'wayland/gdkglcontext-wayland.c',
|
|
|
|
'wayland/gdkkeys-wayland.c',
|
|
|
|
'wayland/gdkmonitor-wayland.c',
|
|
|
|
'wayland/gdkscreen-wayland.c',
|
|
|
|
'wayland/gdkselection-wayland.c',
|
|
|
|
'wayland/gdkwindow-wayland.c',
|
|
|
|
'wayland/wm-button-layout-translation.c',
|
2018-11-19 20:07:09 +00:00
|
|
|
)
|
2018-11-13 05:29:03 +00:00
|
|
|
|
|
|
|
gdk_broadway_sources = files([
|
|
|
|
'broadway/gdkdisplay-broadway.c',
|
|
|
|
'broadway/gdkscreen-broadway.c',
|
|
|
|
'broadway/broadway-output.c',
|
|
|
|
'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/gdkmonitor-broadway.c',
|
|
|
|
'broadway/gdkkeys-broadway.c',
|
|
|
|
'broadway/gdkglobals-broadway.c',
|
|
|
|
'broadway/gdkeventsource.c',
|
|
|
|
'broadway/gdkdnd-broadway.c',
|
|
|
|
'broadway/broadwayd.c',
|
|
|
|
'broadway/gdkdevicemanager-broadway.c',
|
|
|
|
'broadway/gdkdevice-broadway.c',
|
|
|
|
'broadway/broadway-buffer.c',
|
|
|
|
'broadway/gdktestutils-broadway.c',
|
|
|
|
'broadway/gdkproperty-broadway.c'
|
|
|
|
])
|
|
|
|
|
2018-11-19 20:07:09 +00:00
|
|
|
gdk_gresource_xml = configure_file(output : 'gdk.gresource.xml',
|
|
|
|
input : 'gen-gdk-gresources-xml.py',
|
|
|
|
command : [find_program('gen-gdk-gresources-xml.py'),
|
|
|
|
meson.current_source_dir(), '@OUTPUT@'])
|
2018-11-13 05:29:03 +00:00
|
|
|
|
2018-11-19 20:07:09 +00:00
|
|
|
gdkresources = gnome.compile_resources('gdkresources',
|
|
|
|
gdk_gresource_xml,
|
2018-11-13 05:29:03 +00:00
|
|
|
source_dir: '.',
|
|
|
|
c_name: '_gdk',
|
|
|
|
extra_args: '--manual-register'
|
|
|
|
)
|
|
|
|
|
2018-11-19 20:07:09 +00:00
|
|
|
gdk_enums = gnome.mkenums('gdkenumtypes',
|
|
|
|
sources: gdk_public_headers,
|
|
|
|
c_template : 'gdkenumtypes.c.template',
|
|
|
|
h_template : 'gdkenumtypes.h.template',
|
|
|
|
install_dir: join_paths(gtk_includedir, 'gtk-3.0/gdk'),
|
|
|
|
install_header : true)
|
2018-11-13 05:29:03 +00:00
|
|
|
|
2018-11-19 20:07:09 +00:00
|
|
|
gdkenum_h = gdk_enums[1]
|
2018-11-13 05:29:03 +00:00
|
|
|
|
2018-11-19 20:07:09 +00:00
|
|
|
gdk_marshalers = gnome.genmarshal('gdkmarshalers',
|
|
|
|
sources : 'gdkmarshalers.list',
|
|
|
|
prefix : '_gdk_marshal',
|
|
|
|
valist_marshallers : true)
|
2018-11-13 05:29:03 +00:00
|
|
|
|
2018-11-19 20:07:09 +00:00
|
|
|
gdkmarshal_h = gdk_marshalers[1]
|
2018-11-13 05:29:03 +00:00
|
|
|
|
2018-11-19 20:07:09 +00:00
|
|
|
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_WIN32', win32_enabled)
|
|
|
|
gdkconfig_cdata.set('GDK_WINDOWING_BROADWAY', broadway_enabled)
|
2018-11-13 05:29:03 +00:00
|
|
|
|
|
|
|
gdkconfig = configure_file(
|
|
|
|
input : 'gdkconfig.h.meson',
|
|
|
|
output : 'gdkconfig.h',
|
2018-11-19 20:07:09 +00:00
|
|
|
configuration : gdkconfig_cdata,
|
2019-03-31 17:11:11 +00:00
|
|
|
install_dir: join_paths(gtk_includedir, 'gtk-3.0/gdk'))
|
2018-11-19 20:07:09 +00:00
|
|
|
|
|
|
|
|
|
|
|
gdkversion_cdata = configuration_data()
|
|
|
|
gdkversion_cdata.set('GTK_MAJOR_VERSION', gtk_major_version)
|
|
|
|
gdkversion_cdata.set('GTK_MINOR_VERSION', gtk_minor_version)
|
|
|
|
gdkversion_cdata.set('GTK_MICRO_VERSION', gtk_micro_version)
|
2019-03-13 06:01:13 +00:00
|
|
|
gdkversion_cdata.set('GTK_API_VERSION', gtk_api_version)
|
|
|
|
gdkversion_cdata.set('GTK_BINARY_VERSION', gtk_binary_version)
|
|
|
|
gdkversion_cdata.set('GTK_VERSION', meson.project_version())
|
2019-03-31 17:13:34 +00:00
|
|
|
gdkversion_cdata.set('LT_CURRENT_MINUS_AGE', gtk_soversion)
|
2018-11-13 05:29:03 +00:00
|
|
|
|
|
|
|
gdkversionmacros = configure_file(
|
|
|
|
input : 'gdkversionmacros.h.in',
|
|
|
|
output : 'gdkversionmacros.h',
|
2018-11-19 20:07:09 +00:00
|
|
|
configuration: gdkversion_cdata,
|
|
|
|
install_dir: join_paths(gtk_includedir, 'gtk-3.0/gdk'))
|
|
|
|
|
|
|
|
gdkinc = include_directories('.')
|
|
|
|
gdkx11_inc = include_directories('x11')
|
|
|
|
gdkwayland_inc = include_directories('wayland')
|
2018-11-13 05:29:03 +00:00
|
|
|
|
|
|
|
wlinc = include_directories('.')
|
|
|
|
|
2018-11-19 20:07:09 +00:00
|
|
|
gdk_gen_headers = [gdkenum_h, gdkmarshal_h, gdkconfig, gdkversionmacros]
|
2018-11-13 05:29:03 +00:00
|
|
|
|
|
|
|
gdk_deps = [
|
2018-11-19 20:07:09 +00:00
|
|
|
libm,
|
2018-11-13 05:29:03 +00:00
|
|
|
pixbuf_dep,
|
|
|
|
cairo_dep,
|
|
|
|
pango_dep,
|
2019-03-22 11:15:48 +00:00
|
|
|
fribidi_dep,
|
2018-11-13 05:29:03 +00:00
|
|
|
cairogobj_dep,
|
|
|
|
glib_dep,
|
|
|
|
epoxy_dep,
|
|
|
|
fontconfig_dep,
|
2018-11-19 20:07:09 +00:00
|
|
|
platform_gio_dep,
|
2018-11-13 05:29:03 +00:00
|
|
|
pangocairo_dep
|
|
|
|
]
|
|
|
|
|
2018-11-19 20:07:09 +00:00
|
|
|
if win32_enabled
|
|
|
|
gdk_deps += [cc.find_library('advapi32'),
|
|
|
|
cc.find_library('comctl32'),
|
|
|
|
cc.find_library('dwmapi'),
|
|
|
|
cc.find_library('imm32'),
|
|
|
|
cc.find_library('setupapi'),
|
|
|
|
cc.find_library('winmm')]
|
2019-03-13 06:01:13 +00:00
|
|
|
|
|
|
|
gdk_rc = configure_file(
|
|
|
|
input: 'win32/rc/gdk.rc.in',
|
|
|
|
output: 'gdk.rc',
|
|
|
|
configuration: gdkversion_cdata,
|
|
|
|
)
|
|
|
|
gdk_res = import('windows').compile_resources(gdk_rc, include_directories: include_directories('win32/rc'))
|
|
|
|
gdk_sources += gdk_res
|
2018-11-19 20:07:09 +00:00
|
|
|
endif
|
|
|
|
|
2019-06-06 23:19:36 +00:00
|
|
|
if profiler_enabled
|
|
|
|
if profiler_dep.found()
|
|
|
|
gdk_deps += [profiler_dep]
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2018-11-13 05:29:03 +00:00
|
|
|
gdk_sources = [
|
2018-11-19 20:07:09 +00:00
|
|
|
# Generated
|
2018-11-13 05:29:03 +00:00
|
|
|
gdkconfig,
|
2018-11-19 20:07:09 +00:00
|
|
|
gdk_enums,
|
|
|
|
gdk_marshalers,
|
2018-11-13 05:29:03 +00:00
|
|
|
gdkresources,
|
|
|
|
gdkversionmacros,
|
2018-11-19 20:07:09 +00:00
|
|
|
# Static
|
|
|
|
gdk_sources,
|
|
|
|
deprecated_gdk_sources,
|
2018-11-13 05:29:03 +00:00
|
|
|
]
|
|
|
|
|
2018-11-19 20:07:09 +00:00
|
|
|
if wayland_enabled or broadway_enabled
|
|
|
|
if cc.has_function('shm_open')
|
|
|
|
shmlib = []
|
|
|
|
elif cc.has_function('shm_open', args : '-lrt')
|
|
|
|
shmlib = cc.find_library('rt')
|
|
|
|
else
|
|
|
|
shmlib = []
|
|
|
|
endif
|
2018-11-13 05:29:03 +00:00
|
|
|
endif
|
|
|
|
|
2018-11-19 20:07:09 +00:00
|
|
|
gdk_backends = []
|
|
|
|
gdk_backends_gen_headers = [] # non-public generated headers
|
2019-06-17 17:50:42 +00:00
|
|
|
foreach backend : ['broadway', 'quartz', 'wayland', 'win32', 'x11', 'mir']
|
2018-11-19 20:07:09 +00:00
|
|
|
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
|
2018-11-25 17:25:32 +00:00
|
|
|
if backend == 'quartz'
|
|
|
|
common_cflags += ['-DGDK_WINDOWING_QUARTZ', '-xobjective-c']
|
|
|
|
endif
|
2018-11-19 20:07:09 +00:00
|
|
|
endif
|
|
|
|
endforeach
|
|
|
|
|
|
|
|
if gdk_backends.length() == 0
|
|
|
|
error('No backends enabled')
|
2018-11-13 05:29:03 +00:00
|
|
|
endif
|
|
|
|
|
2019-03-13 04:52:25 +00:00
|
|
|
gdk_link_args = common_ldflags
|
|
|
|
|
|
|
|
# Somehow gdk_win32_display_manager_get_type is not being exported as it
|
|
|
|
# seems that it was optimized out by the MSVC linker. Force-export it here.
|
|
|
|
if cc.get_id() == 'msvc'
|
|
|
|
gdk_link_args += [ '-export:gdk_win32_display_manager_get_type' ]
|
|
|
|
endif
|
|
|
|
|
2018-11-19 20:07:09 +00:00
|
|
|
libgdk = shared_library('gdk-3',
|
2019-03-30 07:48:22 +00:00
|
|
|
soversion: gtk_soversion,
|
2019-04-11 18:33:25 +00:00
|
|
|
version: gtk_library_version,
|
2018-11-19 20:07:09 +00:00
|
|
|
sources: [gdk_sources, gdk_backends_gen_headers, gdkconfig],
|
|
|
|
dependencies: gdk_deps,
|
|
|
|
include_directories: [confinc, gdkx11_inc, wlinc],
|
|
|
|
c_args: [
|
|
|
|
'-DGDK_COMPILATION',
|
|
|
|
'-DG_LOG_DOMAIN="Gdk"',
|
|
|
|
] + common_cflags,
|
|
|
|
link_whole: gdk_backends,
|
2019-03-13 04:52:25 +00:00
|
|
|
link_args: gdk_link_args,
|
2018-11-25 17:17:29 +00:00
|
|
|
darwin_versions : gtk_osxversions,
|
2018-11-19 20:07:09 +00:00
|
|
|
install: true)
|
2018-11-13 05:29:03 +00:00
|
|
|
|
2018-12-03 13:09:41 +00:00
|
|
|
gdk_dep_sources = [gdkconfig, gdkenum_h]
|
|
|
|
# Introspection
|
|
|
|
if build_gir
|
|
|
|
gir_args = ['--quiet']
|
|
|
|
|
|
|
|
# We may build some of the dependencies as sub-projects; this means
|
|
|
|
# that we need to depend on the built introspection data, instead of
|
|
|
|
# the installed one
|
|
|
|
gdk_gir_inc = [ 'cairo-1.0', 'Gio-2.0', ]
|
|
|
|
|
|
|
|
if pixbuf_dep.type_name() == 'internal'
|
|
|
|
gdk_gir_inc += subproject('gdk-pixbuf').get_variable('gdkpixbuf_gir').get(0)
|
|
|
|
else
|
|
|
|
gdk_gir_inc += 'GdkPixbuf-2.0'
|
|
|
|
endif
|
|
|
|
|
|
|
|
if pango_dep.type_name() == 'internal'
|
|
|
|
gdk_gir_inc += subproject('pango').get_variable('pango_gir').get(0)
|
|
|
|
else
|
|
|
|
gdk_gir_inc += 'Pango-1.0'
|
|
|
|
endif
|
|
|
|
|
|
|
|
gdk_gir_sources = gdk_gir_public_headers + deprecated_h_sources
|
|
|
|
gdk_gir_sources += gdk_sources + gdk_enums + [gdkconfig]
|
|
|
|
gdk_gir = gnome.generate_gir(libgdk,
|
|
|
|
sources: gdk_gir_sources,
|
|
|
|
namespace: 'Gdk',
|
|
|
|
nsversion: gtk_api_version,
|
|
|
|
identifier_prefix: 'Gdk',
|
|
|
|
symbol_prefix: 'gdk',
|
|
|
|
export_packages: 'gdk-3.0',
|
|
|
|
includes: gdk_gir_inc,
|
|
|
|
header: 'gdk/gdk.h',
|
|
|
|
install: true,
|
|
|
|
extra_args: gir_args + [
|
|
|
|
'-DGDK_COMPILATION',
|
|
|
|
])
|
|
|
|
gdk_gir_dep = declare_dependency(sources: gdk_gir)
|
|
|
|
gdk_dep_sources += gdk_gir
|
|
|
|
|
|
|
|
if x11_enabled
|
|
|
|
gdk_x11_gir = gnome.generate_gir(libgdk,
|
|
|
|
sources: gdk_x11_public_headers + gdk_x11_sources,
|
|
|
|
namespace: 'GdkX11',
|
|
|
|
nsversion: gtk_api_version,
|
|
|
|
identifier_prefix: 'Gdk',
|
|
|
|
symbol_prefix: 'gdk',
|
|
|
|
export_packages: 'gdk-x11-3.0',
|
|
|
|
includes: gdk_gir_inc + [ gdk_gir[0], 'xlib-2.0', ],
|
|
|
|
install: true,
|
|
|
|
dependencies: gdk_gir_dep,
|
|
|
|
header: 'gdk/gdkx.h',
|
|
|
|
extra_args: gir_args + [
|
|
|
|
'-DGDK_COMPILATION',
|
|
|
|
])
|
|
|
|
gdk_dep_sources += gdk_x11_gir
|
|
|
|
endif
|
|
|
|
|
|
|
|
if win32_enabled
|
|
|
|
gdk_win32_gir = gnome.generate_gir(libgdk,
|
|
|
|
sources: gdk_win32_public_headers + gdk_win32_sources,
|
|
|
|
namespace: 'GdkWin32',
|
|
|
|
nsversion: gtk_api_version,
|
|
|
|
identifier_prefix: 'Gdk',
|
|
|
|
symbol_prefix: 'gdk',
|
|
|
|
export_packages: 'gdk-win32-3.0',
|
|
|
|
includes: gdk_gir_inc + [gdk_gir[0]],
|
|
|
|
install: true,
|
|
|
|
dependencies: gdk_gir_dep,
|
|
|
|
header: 'gdk/gdkwin32.h',
|
|
|
|
extra_args: gir_args + [
|
|
|
|
'-DGDK_COMPILATION',
|
|
|
|
])
|
2019-03-13 04:46:38 +00:00
|
|
|
gdk_dep_sources += gdk_win32_gir
|
2018-12-03 13:09:41 +00:00
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2018-11-13 05:29:03 +00:00
|
|
|
libgdk_dep = declare_dependency(
|
|
|
|
link_with: libgdk,
|
2018-12-03 13:09:41 +00:00
|
|
|
sources: gdk_dep_sources,
|
2018-11-19 20:07:09 +00:00
|
|
|
include_directories: [confinc, gdkx11_inc, wlinc],
|
|
|
|
dependencies: gdk_deps)
|