build: Use a consistent style for Meson files

This commit is contained in:
Emmanuele Bassi 2020-12-15 12:31:38 +00:00
parent e75e44bdcc
commit 99e0929d6c
30 changed files with 787 additions and 640 deletions

View File

@ -8,14 +8,16 @@ constraint_editor_sources = [
]
constraint_editor_resources = gnome.compile_resources('constraint_editor_resources',
'constraint-editor.gresource.xml',
source_dir: '.')
'constraint-editor.gresource.xml',
source_dir: '.',
)
executable('gtk4-constraint-editor',
constraint_editor_sources, constraint_editor_resources,
c_args: common_cflags,
dependencies: libgtk_dep,
include_directories: confinc,
gui_app: true,
link_args: extra_demo_ldflags,
install: false)
sources: [ constraint_editor_sources, constraint_editor_resources, ],
c_args: common_cflags,
dependencies: libgtk_dep,
include_directories: confinc,
gui_app: true,
link_args: extra_demo_ldflags,
install: false,
)

View File

@ -100,31 +100,33 @@ demos = files([
gtkdemo_deps = [ libgtk_dep, ]
extra_demo_sources = files(['main.c',
'fontify.c',
'gtkfishbowl.c',
'fontplane.c',
'gtkgears.c',
'gtkshaderbin.c',
'gtkshadertoy.c',
'gtkshaderstack.c',
'gskshaderpaintable.c',
'puzzlepiece.c',
'bluroverlay.c',
'demoimage.c',
'demotaggedentry.c',
'demochild.c',
'demolayout.c',
'demowidget.c',
'demo2layout.c',
'singular_value_decomposition.c',
'four_point_transform.c',
'demo2widget.c',
'demo3widget.c',
'pixbufpaintable.c',
'script-names.c',
'unicode-names.c',
'suggestionentry.c'])
extra_demo_sources = files([
'main.c',
'fontify.c',
'gtkfishbowl.c',
'fontplane.c',
'gtkgears.c',
'gtkshaderbin.c',
'gtkshadertoy.c',
'gtkshaderstack.c',
'gskshaderpaintable.c',
'puzzlepiece.c',
'bluroverlay.c',
'demoimage.c',
'demotaggedentry.c',
'demochild.c',
'demolayout.c',
'demowidget.c',
'demo2layout.c',
'singular_value_decomposition.c',
'four_point_transform.c',
'demo2widget.c',
'demo3widget.c',
'pixbufpaintable.c',
'script-names.c',
'unicode-names.c',
'suggestionentry.c',
])
if harfbuzz_dep.found() and pangoft_dep.found()
demos += files(['font_features.c'])
@ -147,14 +149,17 @@ endif
gtkdemo_args = [ '-DGDK_DISABLE_DEPRECATED', '-DGTK_DISABLE_DEPRECATED', ]
demos_h = custom_target('gtk4 demo header',
output: 'demos.h',
input: demos,
command: [ find_program('geninclude.py'), '@OUTPUT@', '@INPUT@' ])
output: 'demos.h',
input: demos,
command: [ find_program('geninclude.py'), '@OUTPUT@', '@INPUT@' ],
)
gtkdemo_resources = gnome.compile_resources('gtkdemo_resources',
'demo.gresource.xml',
source_dir: '.')
'demo.gresource.xml',
source_dir: '.',
)
# Use a subset of compiler flags
demo_cflags = []
foreach flag: common_cflags
if flag not in ['-Werror=missing-prototypes', '-Werror=missing-declarations', '-fvisibility=hidden']
@ -163,30 +168,30 @@ foreach flag: common_cflags
endforeach
executable('gtk4-demo',
demos, demos_h, extra_demo_sources, gtkdemo_resources,
c_args: gtkdemo_args + demo_cflags,
dependencies: gtkdemo_deps,
include_directories: confinc,
gui_app: true,
link_args: extra_demo_ldflags,
install: true)
sources: [demos, demos_h, extra_demo_sources, gtkdemo_resources],
c_args: gtkdemo_args + demo_cflags,
dependencies: gtkdemo_deps,
include_directories: confinc,
gui_app: true,
link_args: extra_demo_ldflags,
install: true,
)
executable('gtk4-demo-application',
'application.c', gtkdemo_resources,
c_args: gtkdemo_args + common_cflags,
dependencies: gtkdemo_deps,
include_directories: confinc,
gui_app: true,
link_args: extra_demo_ldflags,
install: true)
sources: ['application.c', gtkdemo_resources],
c_args: gtkdemo_args + common_cflags,
dependencies: gtkdemo_deps,
include_directories: confinc,
gui_app: true,
link_args: extra_demo_ldflags,
install: true,
)
# icons
icontheme_dir = join_paths(gtk_datadir, 'icons/hicolor')
foreach size: ['scalable', 'symbolic']
install_subdir('data/' + size,
install_dir: icontheme_dir
)
install_subdir('data/' + size, install_dir: icontheme_dir)
endforeach
# desktop file

View File

@ -7,25 +7,25 @@ iconbrowser_sources = [
]
iconbrowser_resources = gnome.compile_resources('iconbrowser_resources',
'iconbrowser.gresource.xml',
source_dir: '.')
'iconbrowser.gresource.xml',
source_dir: '.',
)
executable('gtk4-icon-browser',
iconbrowser_sources, iconbrowser_resources,
c_args: common_cflags,
dependencies: libgtk_dep,
include_directories: confinc,
gui_app: true,
link_args: extra_demo_ldflags,
install: true)
sources: [iconbrowser_sources, iconbrowser_resources],
c_args: common_cflags,
dependencies: libgtk_dep,
include_directories: confinc,
gui_app: true,
link_args: extra_demo_ldflags,
install: true,
)
# icons
icontheme_dir = join_paths(gtk_datadir, 'icons/hicolor')
foreach size: ['scalable', 'symbolic']
install_subdir('data/' + size,
install_dir: icontheme_dir
)
install_subdir('data/' + size, install_dir: icontheme_dir)
endforeach
# desktop file

View File

@ -6,25 +6,25 @@ node_editor_sources = [
]
node_editor_resources = gnome.compile_resources('node_editor_resources',
'node-editor.gresource.xml',
source_dir: '.')
'node-editor.gresource.xml',
source_dir: '.',
)
executable('gtk4-node-editor',
node_editor_sources, node_editor_resources,
dependencies: libgtk_dep,
include_directories: confinc,
c_args: [
'-DNODE_EDITOR_SOURCE_DIR="@0@/../../testsuite/gsk/compare/"'.format(meson.current_source_dir())
] + common_cflags,
gui_app: true,
link_args: extra_demo_ldflags,
install: false)
sources: [node_editor_sources, node_editor_resources],
dependencies: libgtk_dep,
include_directories: confinc,
c_args: [
'-DNODE_EDITOR_SOURCE_DIR="@0@/../../testsuite/gsk/compare/"'.format(meson.current_source_dir())
] + common_cflags,
gui_app: true,
link_args: extra_demo_ldflags,
install: false,
)
# icons, don't install them until we decide to install gtk4-node-editor
#icontheme_dir = join_paths(gtk_datadir, 'icons/hicolor')
#foreach size: ['scalable', 'symbolic']
# install_subdir('data/' + size,
# install_dir: icontheme_dir
# )
# install_subdir('data/' + size, install_dir: icontheme_dir)
#endforeach

View File

@ -1,11 +1,12 @@
executable('gtk4-print-editor',
['print-editor.c'],
c_args: common_cflags,
dependencies: libgtk_dep,
include_directories: confinc,
gui_app: true,
link_args: extra_demo_ldflags,
install: true)
sources: ['print-editor.c'],
c_args: common_cflags,
dependencies: libgtk_dep,
include_directories: confinc,
gui_app: true,
link_args: extra_demo_ldflags,
install: true,
)
# desktop file
install_data('org.gtk.PrintEditor4.desktop', install_dir: gtk_applicationsdir)
@ -17,7 +18,5 @@ install_data('org.gtk.PrintEditor4.appdata.xml', install_dir: gtk_appdatadir)
icontheme_dir = join_paths(gtk_datadir, 'icons/hicolor')
foreach size: ['scalable', 'symbolic']
install_subdir('data/' + size,
install_dir: icontheme_dir
)
install_subdir('data/' + size, install_dir: icontheme_dir)
endforeach

View File

@ -1,17 +1,19 @@
# demos/widget-factory
widgetfactory_resources = gnome.compile_resources('widgetfactory_resources',
'widget-factory.gresource.xml',
source_dir: '.')
'widget-factory.gresource.xml',
source_dir: '.',
)
executable('gtk4-widget-factory',
'widget-factory.c', widgetfactory_resources,
c_args: common_cflags,
dependencies: libgtk_dep,
include_directories: confinc,
gui_app: true,
link_args: extra_demo_ldflags,
install: true)
sources: ['widget-factory.c', widgetfactory_resources],
c_args: common_cflags,
dependencies: libgtk_dep,
include_directories: confinc,
gui_app: true,
link_args: extra_demo_ldflags,
install: true,
)
# desktop file
install_data('org.gtk.WidgetFactory4.desktop', install_dir: gtk_applicationsdir)
@ -20,9 +22,7 @@ install_data('org.gtk.WidgetFactory4.desktop', install_dir: gtk_applicationsdir)
icontheme_dir = join_paths(gtk_datadir, 'icons/hicolor')
foreach size: ['scalable', 'symbolic']
install_subdir('data/' + size,
install_dir: icontheme_dir
)
install_subdir('data/' + size, install_dir: icontheme_dir)
endforeach
# appdata

View File

@ -159,25 +159,26 @@ if get_option('gtk_doc')
configure_file(input: 'version.xml.in', output: 'version.xml', configuration: version_conf)
gnome.gtkdoc('gdk4',
mode: 'none',
main_xml: 'gdk4-docs.xml',
src_dir: src_dir,
dependencies: libgtk_dep,
gobject_typesfile: join_paths(meson.current_source_dir(), 'gdk4.types'),
scan_args: [
'--ignore-decorators=_GDK_EXTERN|G_GNUC_WARN_UNUSED_RESULT',
'--ignore-headers=' + ' '.join(private_headers),
],
mkdb_args: [
'--ignore-files=' + ' '.join(private_headers),
],
fixxref_args: [
'--html-dir=@0@'.format(docpath),
'--extra-dir=@0@'.format(join_paths(glib_docpath, 'glib')),
'--extra-dir=@0@'.format(join_paths(glib_docpath, 'gobject')),
'--extra-dir=@0@'.format(join_paths(glib_docpath, 'gio')),
'--extra-dir=@0@'.format(cairo_docpath),
],
html_assets: images,
install: true)
mode: 'none',
main_xml: 'gdk4-docs.xml',
src_dir: src_dir,
dependencies: libgtk_dep,
gobject_typesfile: join_paths(meson.current_source_dir(), 'gdk4.types'),
scan_args: [
'--ignore-decorators=_GDK_EXTERN|G_GNUC_WARN_UNUSED_RESULT',
'--ignore-headers=' + ' '.join(private_headers),
],
mkdb_args: [
'--ignore-files=' + ' '.join(private_headers),
],
fixxref_args: [
'--html-dir=@0@'.format(docpath),
'--extra-dir=@0@'.format(join_paths(glib_docpath, 'glib')),
'--extra-dir=@0@'.format(join_paths(glib_docpath, 'gobject')),
'--extra-dir=@0@'.format(join_paths(glib_docpath, 'gio')),
'--extra-dir=@0@'.format(cairo_docpath),
],
html_assets: images,
install: true,
)
endif

View File

@ -40,25 +40,29 @@ if get_option('gtk_doc')
configure_file(input: 'version.xml.in', output: 'version.xml', configuration: version_conf)
gnome.gtkdoc('gsk4',
mode: 'none',
main_xml: 'gsk4-docs.xml',
src_dir: [
gskinc,
],
dependencies: libgtk_dep,
gobject_typesfile: join_paths(meson.current_source_dir(), 'gsk4.types'),
scan_args: [
'--ignore-decorators=_GDK_EXTERN',
'--ignore-headers=' + ' '.join(private_headers),
],
fixxref_args: [
'--html-dir=@0@'.format(docpath),
'--extra-dir=@0@'.format(join_paths(glib_docpath, 'glib')),
'--extra-dir=@0@'.format(join_paths(glib_docpath, 'gobject')),
'--extra-dir=@0@'.format(join_paths(glib_docpath, 'gio')),
'--extra-dir=@0@'.format(cairo_docpath),
'--extra-dir=../gdk',
],
html_assets: images,
install: true)
mode: 'none',
main_xml: 'gsk4-docs.xml',
src_dir: [
gskinc,
],
dependencies: libgtk_dep,
gobject_typesfile: join_paths(meson.current_source_dir(), 'gsk4.types'),
scan_args: [
'--ignore-decorators=_GDK_EXTERN',
'--ignore-headers=' + ' '.join(private_headers),
],
mkdb_args: [
'--ignore-files=' + ' '.join(private_headers),
],
fixxref_args: [
'--html-dir=@0@'.format(docpath),
'--extra-dir=@0@'.format(join_paths(glib_docpath, 'glib')),
'--extra-dir=@0@'.format(join_paths(glib_docpath, 'gobject')),
'--extra-dir=@0@'.format(join_paths(glib_docpath, 'gio')),
'--extra-dir=@0@'.format(cairo_docpath),
'--extra-dir=../gdk',
],
html_assets: images,
install: true,
)
endif

View File

@ -460,44 +460,46 @@ if get_option('gtk_doc')
expand_md_targets = []
foreach t : expand_content_md_files
expand_md_targets += custom_target(t,
input: [ t ],
output: [ fs.replace_suffix(t, '.xml') ],
command: [ expand_md, '@INPUT@', '@OUTPUT@'])
input: [ t ],
output: [ fs.replace_suffix(t, '.xml') ],
command: [ expand_md, '@INPUT@', '@OUTPUT@'],
)
endforeach
gnome.gtkdoc('gtk4',
mode: 'none',
main_xml: 'gtk4-docs.xml',
src_dir: [
gtkinc,
],
dependencies: libgtk_dep,
gobject_typesfile: configure_file(
input: 'gtk4.types.in',
output: 'gtk4.types',
configuration: types_conf,
),
scan_args: [
'--ignore-decorators=_GDK_EXTERN|G_GNUC_WARN_UNUSED_RESULT',
'--ignore-headers=' + ' '.join(private_headers),
],
mkdb_args: [
'--default-includes=gtk/gtk.h',
'--ignore-files=' + ' '.join(private_headers),
],
fixxref_args: [
'--html-dir=@0@'.format(docpath),
'--extra-dir=@0@'.format(join_paths(glib_docpath, 'glib')),
'--extra-dir=@0@'.format(join_paths(glib_docpath, 'gobject')),
'--extra-dir=@0@'.format(join_paths(glib_docpath, 'gio')),
'--extra-dir=@0@'.format(cairo_docpath),
'--extra-dir=@0@'.format(gdkpixbuf_docpath),
'--extra-dir=../gdk',
'--extra-dir=../gsk',
],
content_files: content_files + expand_md_targets,
html_assets: images,
install: true)
mode: 'none',
main_xml: 'gtk4-docs.xml',
src_dir: [
gtkinc,
],
dependencies: libgtk_dep,
gobject_typesfile: configure_file(
input: 'gtk4.types.in',
output: 'gtk4.types',
configuration: types_conf,
),
scan_args: [
'--ignore-decorators=_GDK_EXTERN|G_GNUC_WARN_UNUSED_RESULT',
'--ignore-headers=' + ' '.join(private_headers),
],
mkdb_args: [
'--default-includes=gtk/gtk.h',
'--ignore-files=' + ' '.join(private_headers),
],
fixxref_args: [
'--html-dir=@0@'.format(docpath),
'--extra-dir=@0@'.format(join_paths(glib_docpath, 'glib')),
'--extra-dir=@0@'.format(join_paths(glib_docpath, 'gobject')),
'--extra-dir=@0@'.format(join_paths(glib_docpath, 'gio')),
'--extra-dir=@0@'.format(cairo_docpath),
'--extra-dir=@0@'.format(gdkpixbuf_docpath),
'--extra-dir=../gdk',
'--extra-dir=../gsk',
],
content_files: content_files + expand_md_targets,
html_assets: images,
install: true,
)
endif
xsltproc = find_program('xsltproc', required: false)
@ -532,16 +534,17 @@ if get_option('man-pages') and xsltproc.found()
man_name = man.get(0)
man_section = man.get(1, '1')
custom_target('@0@.@1@'.format(man_name, man_section),
input: '@0@.xml'.format(man_name),
output: '@0@.@1@'.format(man_name, man_section),
command: [
xsltproc,
xlstproc_flags,
'-o', '@OUTPUT@',
'http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl',
'@INPUT@',
],
install: true,
install_dir: join_paths(get_option('mandir'), 'man@0@'.format(man_section)))
input: '@0@.xml'.format(man_name),
output: '@0@.@1@'.format(man_name, man_section),
command: [
xsltproc,
xlstproc_flags,
'-o', '@OUTPUT@',
'http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl',
'@INPUT@',
],
install: true,
install_dir: join_paths(get_option('mandir'), 'man@0@'.format(man_section)),
)
endforeach
endif

View File

@ -59,16 +59,25 @@ libgdk_broadway = static_library('gdk-broadway',
'-DGTK_COMPILATION',
'-DG_LOG_DOMAIN="Gdk"',
] + common_cflags,
dependencies: [gdk_deps, gdk_broadway_deps])
dependencies: [gdk_deps, gdk_broadway_deps],
)
# gtk4-broadwayd
broadwayd_syslib = os_win32 ? find_library('ws2_32') : shmlib
executable('gtk4-broadwayd',
clienthtml_h, broadwayjs_h, gdkconfig, gdkenum_h,
'broadwayd.c', 'broadway-server.c', 'broadway-output.c',
sources: [
clienthtml_h,
broadwayjs_h,
gdkconfig,
gdkenum_h,
'broadwayd.c',
'broadway-server.c',
'broadway-output.c',
],
include_directories: [confinc, gdkinc, include_directories('.')],
c_args: ['-DGTK_COMPILATION', '-DG_LOG_DOMAIN="Gdk"', ],
dependencies : [broadwayd_syslib, gdk_deps],
install : true)
dependencies: [ broadwayd_syslib, gdk_deps ],
install: true,
)

View File

@ -55,8 +55,9 @@ gdk_macos_deps = [
libgdk_c_args += ['-xobjective-c']
libgdk_macos = static_library('gdk-macos',
gdk_macos_sources, gdkconfig, gdkenum_h,
include_directories: [ confinc, gdkinc, ],
c_args: libgdk_c_args + common_cflags,
link_with: [],
dependencies: gdk_deps + gdk_macos_deps)
gdk_macos_sources, gdkconfig, gdkenum_h,
include_directories: [ confinc, gdkinc, ],
c_args: [ libgdk_c_args, common_cflags, ],
link_with: [],
dependencies: [ gdk_deps, gdk_macos_deps, ],
)

View File

@ -112,32 +112,39 @@ gdk_private_h_sources = files([
'gdktoplevelsizeprivate.h',
])
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@'])
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@',
],
)
gdkresources = gnome.compile_resources('gdkresources',
gdk_gresource_xml,
source_dir: '.',
c_name: '_gdk',
extra_args: '--manual-register')
extra_args: '--manual-register',
)
gdk_headers = gdk_public_headers
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-4.0/gdk'),
install_header : true)
c_template: 'gdkenumtypes.c.template',
h_template: 'gdkenumtypes.h.template',
install_dir: gtk_includedir / 'gtk-4.0/gdk',
install_header: true,
)
gdkenum_h = gdk_enums[1]
gdk_marshalers = gnome.genmarshal('gdkmarshalers',
sources : 'gdkmarshalers.list',
prefix : '_gdk_marshal',
valist_marshallers : true)
sources: 'gdkmarshalers.list',
prefix: '_gdk_marshal',
valist_marshallers: true,
)
gdkmarshal_h = gdk_marshalers[1]
@ -150,11 +157,11 @@ gdkconfig_cdata.set('GDK_WINDOWING_MACOS', macos_enabled)
gdkconfig_cdata.set('GDK_RENDERING_VULKAN', have_vulkan)
gdkconfig = configure_file(
input : 'gdkconfig.h.meson',
output : 'gdkconfig.h',
configuration : gdkconfig_cdata,
install_dir: join_paths(gtk_includedir, 'gtk-4.0/gdk'))
input: 'gdkconfig.h.meson',
output: 'gdkconfig.h',
configuration: gdkconfig_cdata,
install_dir: gtk_includedir / 'gtk-4.0/gdk',
)
gdkversion_cdata = configuration_data()
gdkversion_cdata.set('GTK_MAJOR_VERSION', gtk_major_version)
@ -162,10 +169,11 @@ gdkversion_cdata.set('GTK_MINOR_VERSION', gtk_minor_version)
gdkversion_cdata.set('GTK_MICRO_VERSION', gtk_micro_version)
gdkversionmacros = configure_file(
input : 'gdkversionmacros.h.in',
output : 'gdkversionmacros.h',
input: 'gdkversionmacros.h.in',
output: 'gdkversionmacros.h',
configuration: gdkversion_cdata,
install_dir: join_paths(gtk_includedir, 'gtk-4.0/gdk'))
install_dir: gtk_includedir / 'gtk-4.0/gdk',
)
gdkinc = include_directories('.')
gdkx11_inc = include_directories('x11')
@ -259,4 +267,5 @@ libgdk = static_library('gdk',
libgdk_dep = declare_dependency(
sources: ['gdk.h', gdkconfig, gdkenum_h],
include_directories: [confinc, gdkx11_inc, wlinc],
dependencies: gdk_deps + [libgtk_css_dep])
dependencies: gdk_deps + [libgtk_css_dep],
)

View File

@ -5,7 +5,8 @@ wayland_cursor_sources = files([
])
libwayland_cursor = static_library('wayland+cursor',
sources: wayland_cursor_sources,
include_directories: [ confinc, ],
dependencies: [ glib_dep, wlclientdep, ],
c_args: common_cflags)
sources: wayland_cursor_sources,
include_directories: [ confinc, ],
dependencies: [ glib_dep, wlclientdep, ],
c_args: common_cflags,
)

View File

@ -77,30 +77,38 @@ foreach p: proto_sources
endif
gdk_wayland_gen_headers += custom_target('@0@ client header'.format(output_base),
input: input,
output: '@0@-client-protocol.h'.format(output_base),
command: [
wayland_scanner,
'client-header',
'@INPUT@', '@OUTPUT@',
])
input: input,
output: '@0@-client-protocol.h'.format(output_base),
command: [
wayland_scanner,
'client-header',
'@INPUT@', '@OUTPUT@',
],
)
gdk_wayland_sources += custom_target('@0@ source'.format(output_base),
input: input,
output: '@0@-protocol.c'.format(output_base),
command: [
wayland_scanner,
'private-code',
'@INPUT@', '@OUTPUT@',
])
input: input,
output: '@0@-protocol.c'.format(output_base),
command: [
wayland_scanner,
'private-code',
'@INPUT@', '@OUTPUT@',
],
)
endforeach
libgdk_wayland = static_library('gdk-wayland',
gdk_wayland_sources, gdk_wayland_gen_headers, gdkconfig, gdkenum_h,
include_directories: [ confinc, gdkinc, ],
c_args: [
'-DGTK_COMPILATION',
'-DG_LOG_DOMAIN="Gdk"',
] + common_cflags,
link_with: [libwayland_cursor, ],
dependencies: [ gdk_deps, gdk_wayland_deps])
sources: [
gdk_wayland_sources,
gdk_wayland_gen_headers,
gdkconfig,
gdkenum_h,
],
include_directories: [ confinc, gdkinc, ],
c_args: [
'-DGTK_COMPILATION',
'-DG_LOG_DOMAIN="Gdk"',
] + common_cflags,
link_with: [ libwayland_cursor, ],
dependencies: [ gdk_deps, gdk_wayland_deps ],
)

View File

@ -50,11 +50,16 @@ if win32_has_egl
endif
gdk_win32_deps = [ # FIXME
pangowin32_dep
pangowin32_dep
]
libgdk_win32 = static_library('gdk-win32',
gdk_win32_sources, gdkconfig, gdkenum_h,
include_directories: [confinc, gdkinc],
c_args: ['-DGTK_COMPILATION', '-DG_LOG_DOMAIN="Gdk"', '-DINSIDE_GDK_WIN32'] + GDK_WIN32_EGL_CFLAGS,
dependencies: [gdk_deps, gdk_win32_deps])
include_directories: [ confinc, gdkinc ],
c_args: [
'-DGTK_COMPILATION',
'-DG_LOG_DOMAIN="Gdk"',
'-DINSIDE_GDK_WIN32',
] + GDK_WIN32_EGL_CFLAGS,
dependencies: [ gdk_deps, gdk_win32_deps ],
)

View File

@ -72,11 +72,17 @@ gdk_x11_deps = [
xinerama_dep,
]
libgdk_x11 = static_library('gdk-x11', gdkmarshal_h,
gdk_x11_sources, gdkconfig, gdkenum_h,
include_directories: [ confinc, gdkinc, ],
c_args: [
'-DGTK_COMPILATION',
'-DG_LOG_DOMAIN="Gdk"',
] + common_cflags,
dependencies: [ gdk_deps, gdk_x11_deps, ])
libgdk_x11 = static_library('gdk-x11',
sources: [
gdkmarshal_h,
gdkenum_h,
gdkconfig,
gdk_x11_sources,
],
include_directories: [ confinc, gdkinc, ],
c_args: [
'-DGTK_COMPILATION',
'-DG_LOG_DOMAIN="Gdk"',
] + common_cflags,
dependencies: [ gdk_deps, gdk_x11_deps, ],
)

View File

@ -130,30 +130,33 @@ if get_variable('broadway_enabled')
endif
gsk_resources_xml = configure_file(output: 'gsk.resources.xml',
input: 'gen-gsk-gresources-xml.py',
command: [
find_program('gen-gsk-gresources-xml.py'),
'@OUTPUT@',
gsk_private_gl_shaders,
gsk_private_vulkan_compiled_shaders,
gsk_private_vulkan_shaders
])
input: 'gen-gsk-gresources-xml.py',
command: [
find_program('gen-gsk-gresources-xml.py'),
'@OUTPUT@',
gsk_private_gl_shaders,
gsk_private_vulkan_compiled_shaders,
gsk_private_vulkan_shaders
],
)
gsk_enums = gnome.mkenums('gskenumtypes',
sources: gsk_public_headers,
c_template: 'gskenumtypes.c.template',
h_template: 'gskenumtypes.h.template',
install_dir: join_paths(gtk_includedir, 'gtk-4.0/gsk'),
install_header: true)
sources: gsk_public_headers,
c_template: 'gskenumtypes.c.template',
h_template: 'gskenumtypes.h.template',
install_dir: gtk_includedir / 'gtk-4.0/gsk',
install_header: true,
)
gskenum_h = gsk_enums[1]
gskresources = gnome.compile_resources('gskresources',
gsk_resources_xml,
dependencies: gsk_private_vulkan_compiled_shaders_deps,
source_dir: '.',
c_name: '_gsk',
extra_args: [ '--manual-register', ])
gsk_resources_xml,
dependencies: gsk_private_vulkan_compiled_shaders_deps,
source_dir: '.',
c_name: '_gsk',
extra_args: [ '--manual-register', ],
)
gsk_gen_headers = [ gskenum_h, ]
@ -167,19 +170,26 @@ gsk_deps = [
]
libgsk = static_library('gsk',
sources: [ gsk_public_sources, gsk_private_sources, gsk_enums, gskresources, ],
dependencies: gsk_deps,
include_directories: [ confinc, ],
c_args: [
'-DGTK_COMPILATION',
'-DG_LOG_DOMAIN="Gsk"',
'-DG_LOG_STRUCTURED=1',
] + common_cflags,
link_with: libgdk)
sources: [
gsk_public_sources,
gsk_private_sources,
gsk_enums,
gskresources,
],
dependencies: gsk_deps,
include_directories: [ confinc, ],
c_args: [
'-DGTK_COMPILATION',
'-DG_LOG_DOMAIN="Gsk"',
'-DG_LOG_STRUCTURED=1',
] + common_cflags,
link_with: libgdk,
)
# We don't have link_with: to internal static libs here on purpose, just
# list the dependencies and generated headers and such, for use in the
# "public" libgtk_dep used by internal executables.
libgsk_dep = declare_dependency(include_directories: [ confinc, ],
sources: [ gskenum_h, ],
dependencies: libgdk_dep)
sources: [ gskenum_h, ],
dependencies: libgdk_dep,
)

View File

@ -28,30 +28,33 @@ gtk_css_deps = [
]
gtk_css_enums = gnome.mkenums('gtkcssenumtypes',
sources: gtk_css_public_headers,
c_template: 'gtkcssenumtypes.c.template',
h_template: 'gtkcssenumtypes.h.template',
install_dir: join_paths(gtk_includedir, 'gtk-4.0/gtk/css'),
install_header: true)
sources: gtk_css_public_headers,
c_template: 'gtkcssenumtypes.c.template',
h_template: 'gtkcssenumtypes.h.template',
install_dir: join_paths(gtk_includedir, 'gtk-4.0/gtk/css'),
install_header: true,
)
gtk_css_enum_h = gtk_css_enums[1]
libgtk_css = static_library('gtk_css',
sources: [
gtk_css_public_sources,
gtk_css_private_sources,
gtk_css_enums,
],
dependencies: gtk_css_deps,
include_directories: [ confinc, ],
c_args: [
'-DGTK_COMPILATION',
'-DG_LOG_DOMAIN="Gtk"',
] + common_cflags)
sources: [
gtk_css_public_sources,
gtk_css_private_sources,
gtk_css_enums,
],
dependencies: gtk_css_deps,
include_directories: [ confinc, ],
c_args: [
'-DGTK_COMPILATION',
'-DG_LOG_DOMAIN="Gtk"',
] + common_cflags,
)
# We don't have link_with: to internal static libs here on purpose, just
# list the dependencies and generated headers and such, for use in the
# "public" libgtk_dep used by internal executables.
libgtk_css_dep = declare_dependency(include_directories: [ confinc, ],
sources: [ gtk_css_enum_h ],
dependencies: gtk_css_deps)
sources: [ gtk_css_enum_h ],
dependencies: gtk_css_deps,
)

View File

@ -723,22 +723,24 @@ foreach p: proto_sources
# wayland_scanner is defined in gdk/wayland/meson.build
im_wayland_sources += custom_target('@0@ client header'.format(output_base),
input: input,
output: '@0@-client-protocol.h'.format(output_base),
command: [
wayland_scanner,
'client-header',
'@INPUT@', '@OUTPUT@',
])
input: input,
output: '@0@-client-protocol.h'.format(output_base),
command: [
wayland_scanner,
'client-header',
'@INPUT@', '@OUTPUT@',
],
)
im_wayland_sources += custom_target('@0@ source'.format(output_base),
input: input,
output: '@0@-protocol.c'.format(output_base),
command: [
wayland_scanner,
'private-code',
'@INPUT@', '@OUTPUT@',
])
input: input,
output: '@0@-protocol.c'.format(output_base),
command: [
wayland_scanner,
'private-code',
'@INPUT@', '@OUTPUT@',
],
)
endif
endforeach
@ -827,11 +829,12 @@ endif
gen_gtk_gresources_xml = find_program('gen-gtk-gresources-xml.py')
gtk_gresources_xml = configure_file(output: 'gtk.gresources.xml',
command: [
gen_gtk_gresources_xml,
meson.current_source_dir(),
'@OUTPUT@'
])
command: [
gen_gtk_gresources_xml,
meson.current_source_dir(),
'@OUTPUT@'
],
)
# Build the theme files
sassc = find_program('sassc', required: false)
@ -866,8 +869,8 @@ foreach lang : [ 'de', 'fr', 'es', 'zh' ]
conf = configuration_data()
conf.set('lang', lang)
resxml = configure_file(input: 'emoji/gresource.xml.in',
output: lang + '.gresource.xml',
configuration: conf
output: lang + '.gresource.xml',
configuration: conf
)
gnome.compile_resources(lang,
@ -875,7 +878,7 @@ foreach lang : [ 'de', 'fr', 'es', 'zh' ]
source_dir: 'emoji',
gresource_bundle: true,
install: true,
install_dir: join_paths(gtk_datadir, 'gtk-4.0', 'emoji')
install_dir: gtk_datadir / 'gtk-4.0/emoji',
)
endforeach
@ -893,49 +896,54 @@ gtk_use_wayland_or_x11_c_sources = files([
])
gtk_dbus_src = gnome.gdbus_codegen('gtkdbusgenerated',
'gtkdbusinterfaces.xml',
interface_prefix: 'org.Gtk.',
namespace: '_Gtk')
'gtkdbusinterfaces.xml',
interface_prefix: 'org.Gtk.',
namespace: '_Gtk',
)
gtkmarshalers = gnome.genmarshal('gtkmarshalers',
sources: 'gtkmarshalers.list',
prefix: '_gtk_marshal',
valist_marshallers: true)
sources: 'gtkmarshalers.list',
prefix: '_gtk_marshal',
valist_marshallers: true,
)
gtkmarshal_h = gtkmarshalers[1]
gtktypebuiltins = gnome.mkenums('gtktypebuiltins',
sources: gtk_public_headers + gtk_deprecated_headers,
c_template: 'gtktypebuiltins.c.template',
h_template: 'gtktypebuiltins.h.template',
install_dir: join_paths(gtk_includedir, 'gtk-4.0/gtk'),
install_header: true)
sources: gtk_public_headers + gtk_deprecated_headers,
c_template: 'gtktypebuiltins.c.template',
h_template: 'gtktypebuiltins.h.template',
install_dir: gtk_includedir / 'gtk-4.0/gtk',
install_header: true,
)
gtktypebuiltins_h = gtktypebuiltins[1]
gtkprivatetypebuiltins = gnome.mkenums('gtkprivatetypebuiltins',
sources: gtk_private_type_headers,
c_template: 'gtkprivatetypebuiltins.c.template',
h_template: 'gtkprivatetypebuiltins.h.template')
sources: gtk_private_type_headers,
c_template: 'gtkprivatetypebuiltins.c.template',
h_template: 'gtkprivatetypebuiltins.h.template',
)
gtkprivatetypebuiltins_h = gtkprivatetypebuiltins[1]
# Generate gtktypefuncs.inc
typefuncs = custom_target('gtktypefuncs.inc',
depends: [ gdkenum_h, gskenum_h, ],
output: 'gtktypefuncs.inc',
input: gdk_headers +
gsk_public_headers +
gtk_public_headers +
gtk_deprecated_headers +
[ gtktypebuiltins_h, ] +
[ gtk_css_enum_h, gdkenum_h, gskenum_h, ],
command: [
find_program('gentypefuncs.py'),
'@OUTPUT@',
'@INPUT@',
],
install: false)
depends: [ gdkenum_h, gskenum_h, ],
output: 'gtktypefuncs.inc',
input: gdk_headers +
gsk_public_headers +
gtk_public_headers +
gtk_deprecated_headers +
[ gtktypebuiltins_h, ] +
[ gtk_css_enum_h, gdkenum_h, gskenum_h, ],
command: [
find_program('gentypefuncs.py'),
'@OUTPUT@',
'@INPUT@',
],
install: false,
)
gtkversion_cdata = configuration_data()
gtkversion_cdata.set('GTK_MAJOR_VERSION', gtk_major_version)
@ -951,9 +959,11 @@ if host_machine.system() == 'windows'
endif
gtkversion = configure_file(input: 'gtkversion.h.in',
output: 'gtkversion.h',
configuration: gtkversion_cdata,
install_dir: join_paths(gtk_includedir, 'gtk-4.0/gtk'))
output: 'gtkversion.h',
configuration: gtkversion_cdata,
install: true,
install_dir: gtk_includedir / 'gtk-4.0/gtk',
)
gtk_gen_headers = [
gtkmarshal_h,
@ -1015,23 +1025,27 @@ if win32_enabled
gtk_cargs += ['-DGTK_PRINT_BACKENDS="file,lpr"']
gtk_deps += [ giowin32_dep, pangowin32_dep ]
gtk_deps += [cc.find_library('advapi32'),
cc.find_library('comctl32'),
cc.find_library('crypt32'), # For CryptProtectMemory()
cc.find_library('dwmapi'),
cc.find_library('imm32'),
cc.find_library('setupapi'),
cc.find_library('winmm')]
gtk_deps += [
cc.find_library('advapi32'),
cc.find_library('comctl32'),
cc.find_library('crypt32'), # For CryptProtectMemory()
cc.find_library('dwmapi'),
cc.find_library('imm32'),
cc.find_library('setupapi'),
cc.find_library('winmm'),
]
gtkwin32rc = configure_file(input: 'gtk-win32.rc.body.in',
output: 'gtk-win32.rc.body',
configuration: gtkversion_cdata)
output: 'gtk-win32.rc.body',
configuration: gtkversion_cdata,
)
win32_manifest = configure_file(input: 'libgtk4.manifest.in',
output: 'libgtk4.manifest',
configuration: gtkversion_cdata)
output: 'libgtk4.manifest',
configuration: gtkversion_cdata,
)
win32res = import('windows').compile_resources(gtkwin32rc, include_directories : win32rcinc)
win32res = import('windows').compile_resources(gtkwin32rc, include_directories: win32rcinc)
gtk_sources += win32res
endif
@ -1066,8 +1080,7 @@ gtk_settings_schemas = [
'org.gtk.gtk4.Settings.Debug.gschema.xml',
]
install_data(gtk_settings_schemas, install_dir: gtk_schemasdir)
gnome.compile_schemas(depend_files: files(gtk_settings_schemas),
build_by_default: true)
gnome.compile_schemas(depend_files: files(gtk_settings_schemas), build_by_default: true)
gtk_schema_build_dir = meson.current_build_dir()
# Check for more things
@ -1088,15 +1101,16 @@ endif
# Library
libgtk = library('gtk-4',
soversion: gtk_soversion,
version: gtk_library_version,
sources: [typefuncs, gtk_sources, gtkmarshal_h, gtkprivatetypebuiltins_h],
c_args: gtk_cargs + common_cflags,
include_directories: [confinc, gdkinc, gskinc, gtkinc],
dependencies: gtk_deps + [libgtk_css_dep, libgdk_dep, libgsk_dep],
link_whole: [libgtk_css, libgdk, libgsk, ],
link_args: common_ldflags + gtk_ldflags,
install: true)
soversion: gtk_soversion,
version: gtk_library_version,
sources: [typefuncs, gtk_sources, gtkmarshal_h, gtkprivatetypebuiltins_h],
c_args: gtk_cargs + common_cflags,
include_directories: [confinc, gdkinc, gskinc, gtkinc],
dependencies: gtk_deps + [libgtk_css_dep, libgdk_dep, libgsk_dep],
link_whole: [libgtk_css, libgdk, libgsk, ],
link_args: common_ldflags + gtk_ldflags,
install: true,
)
gtk_dep_sources = [gtkversion, gtktypebuiltins_h]
@ -1134,50 +1148,50 @@ if build_gir
endif
gdk_gir = gnome.generate_gir(libgtk,
sources: gdk_public_headers + gdk_public_sources + [ gdkenum_h ],
namespace: 'Gdk',
nsversion: gtk_api_version,
identifier_prefix: 'Gdk',
symbol_prefix: 'gdk',
export_packages: 'gtk4',
includes: gdk_gir_inc,
header: 'gdk/gdk.h',
install: true,
extra_args: gir_args,
sources: gdk_public_headers + gdk_public_sources + [ gdkenum_h ],
namespace: 'Gdk',
nsversion: gtk_api_version,
identifier_prefix: 'Gdk',
symbol_prefix: 'gdk',
export_packages: 'gtk4',
includes: gdk_gir_inc,
header: 'gdk/gdk.h',
install: true,
extra_args: gir_args,
)
gdk_gir_dep = declare_dependency(sources: gdk_gir)
gtk_dep_sources += gdk_gir
if x11_enabled
gdk_x11_gir = gnome.generate_gir(libgtk,
sources: gdk_x11_public_headers + gdk_x11_public_sources,
namespace: 'GdkX11',
nsversion: gtk_api_version,
identifier_prefix: 'Gdk',
symbol_prefix: 'gdk',
export_packages: 'gtk4-x11',
includes: [ gdk_gir[0], 'xlib-2.0', ],
install: true,
dependencies: gdk_gir_dep,
header: 'gdk/x11/gdkx.h',
extra_args: gir_args,
sources: gdk_x11_public_headers + gdk_x11_public_sources,
namespace: 'GdkX11',
nsversion: gtk_api_version,
identifier_prefix: 'Gdk',
symbol_prefix: 'gdk',
export_packages: 'gtk4-x11',
includes: [ gdk_gir[0], 'xlib-2.0', ],
install: true,
dependencies: gdk_gir_dep,
header: 'gdk/x11/gdkx.h',
extra_args: gir_args,
)
gtk_dep_sources += gdk_x11_gir
endif
if wayland_enabled
gdk_wayland_gir = gnome.generate_gir(libgtk,
sources: gdk_wayland_public_headers + gdk_wayland_sources,
namespace: 'GdkWayland',
nsversion: gtk_api_version,
identifier_prefix: 'Gdk',
symbol_prefix: 'gdk',
export_packages: 'gtk4-wayland',
includes: [ gdk_gir[0], ],
install: true,
dependencies: gdk_gir_dep,
header: 'gdk/wayland/gdkwayland.h',
extra_args: gir_args,
sources: gdk_wayland_public_headers + gdk_wayland_sources,
namespace: 'GdkWayland',
nsversion: gtk_api_version,
identifier_prefix: 'Gdk',
symbol_prefix: 'gdk',
export_packages: 'gtk4-wayland',
includes: [ gdk_gir[0], ],
install: true,
dependencies: gdk_gir_dep,
header: 'gdk/wayland/gdkwayland.h',
extra_args: gir_args,
)
gtk_dep_sources += gdk_wayland_gir
endif
@ -1185,17 +1199,17 @@ if build_gir
gsk_gir_inc = [ gdk_gir[0] ]
gsk_gir = gnome.generate_gir(libgtk,
sources: gsk_public_headers + gsk_public_sources + [ gskenum_h ],
namespace: 'Gsk',
nsversion: gtk_api_version,
identifier_prefix: 'Gsk',
symbol_prefix: 'gsk',
export_packages: 'gtk4',
includes: gsk_gir_inc,
header: 'gsk/gsk.h',
install: true,
dependencies: [gdk_gir_dep, graphene_dep],
extra_args: gir_args,
sources: gsk_public_headers + gsk_public_sources + [ gskenum_h ],
namespace: 'Gsk',
nsversion: gtk_api_version,
identifier_prefix: 'Gsk',
symbol_prefix: 'gsk',
export_packages: 'gtk4',
includes: gsk_gir_inc,
header: 'gsk/gsk.h',
install: true,
dependencies: [gdk_gir_dep, graphene_dep],
extra_args: gir_args,
)
gsk_gir_dep = declare_dependency(dependencies: [gdk_gir_dep, graphene_dep],
sources: gsk_gir)
@ -1221,24 +1235,26 @@ if build_gir
endif
gtk_gir = gnome.generate_gir(libgtk,
sources: gtk_introspection_sources,
namespace: 'Gtk',
nsversion: gtk_api_version,
identifier_prefix: 'Gtk',
symbol_prefix: 'gtk',
export_packages: 'gtk4',
includes: [ gdk_gir[0], gsk_gir[0], ],
header: 'gtk/gtk.h',
install: true,
dependencies: gsk_gir_dep,
extra_args: gir_args)
sources: gtk_introspection_sources,
namespace: 'Gtk',
nsversion: gtk_api_version,
identifier_prefix: 'Gtk',
symbol_prefix: 'gtk',
export_packages: 'gtk4',
includes: [ gdk_gir[0], gsk_gir[0], ],
header: 'gtk/gtk.h',
install: true,
dependencies: gsk_gir_dep,
extra_args: gir_args,
)
gtk_dep_sources += gtk_gir
endif
libgtk_dep = declare_dependency(sources: gtk_dep_sources,
include_directories: [confinc, gtkinc],
dependencies: gtk_deps + [libgtk_css_dep, libgdk_dep, libgsk_dep],
link_with: libgtk,
link_args: common_ldflags)
include_directories: [confinc, gtkinc],
dependencies: gtk_deps + [libgtk_css_dep, libgdk_dep, libgsk_dep],
link_with: libgtk,
link_args: common_ldflags,
)
subdir('tools')

View File

@ -18,19 +18,23 @@ foreach tool: gtk_tools
tool_name = tool.get(0)
tool_srcs = tool.get(1)
exe = executable(tool_name, tool_srcs,
include_directories: [confinc],
c_args: common_cflags,
dependencies: libgtk_dep,
install: true)
exe = executable(tool_name,
sources: tool_srcs,
include_directories: [confinc],
c_args: common_cflags,
dependencies: libgtk_dep,
install: true,
)
set_variable(tool_name.underscorify(), exe) # used in testsuites
endforeach
# Data to install
install_data('gtk4builder.rng',
install_dir: join_paths(gtk_datadir, 'gtk-4.0'))
install_data('gtk4builder.loc', 'gtk4builder.its',
install_dir: join_paths(gtk_datadir, 'gettext/its'))
install_data('gtk4builder.rng', install_dir: gtk_datadir / 'gtk-4.0')
install_data([
'gtk4builder.loc',
'gtk4builder.its',
],
install_dir: gtk_datadir / 'gettext/its',
)

View File

@ -32,11 +32,12 @@ if ffmpeg_found
media_backends += 'ffmpeg'
cdata.set('HAVE_FFMPEG', 1)
shared_module('media-ffmpeg',
'gtkffmediafile.c',
c_args: extra_c_args,
dependencies: [ libgtk_dep, ffmpeg_deps ],
install_dir: media_install_dir,
install : true)
sources: 'gtkffmediafile.c',
c_args: extra_c_args,
dependencies: [ libgtk_dep, ffmpeg_deps ],
install_dir: media_install_dir,
install: true,
)
endif
gstplayer_dep = dependency('gstreamer-player-1.0', version: '>= 1.12.3',
@ -45,11 +46,14 @@ if gstplayer_dep.found()
media_backends += 'gstreamer'
cdata.set('HAVE_GSTREAMER', 1)
shared_module('media-gstreamer',
'gtkgstmediafile.c',
'gtkgstpaintable.c',
'gtkgstsink.c',
c_args: extra_c_args,
dependencies: [ libgtk_dep, gstplayer_dep ],
install_dir: media_install_dir,
install : true)
sources: [
'gtkgstmediafile.c',
'gtkgstpaintable.c',
'gtkgstsink.c',
],
c_args: extra_c_args,
dependencies: [ libgtk_dep, gstplayer_dep ],
install_dir: media_install_dir,
install: true,
)
endif

View File

@ -29,23 +29,27 @@ cups_dep = dependency('cups', version : '>=2.0', required: get_option('print-cup
if cups_dep.found()
print_backends += 'cups'
shared_module('printbackend-cups',
'gtkprintbackendcups.c',
'gtkprintercups.c',
'gtkcupsutils.c',
'gtkcupssecretsutils.c',
c_args: printbackends_args,
dependencies: [libgtk_dep, cups_dep, colord_dep],
install_dir: printbackends_install_dir,
install : true)
sources: [
'gtkprintbackendcups.c',
'gtkprintercups.c',
'gtkcupsutils.c',
'gtkcupssecretsutils.c',
],
c_args: printbackends_args,
dependencies: [libgtk_dep, cups_dep, colord_dep],
install_dir: printbackends_install_dir,
install: true,
)
else
# Automatic fall-back to the lpr backend
print_backends += 'lpr'
shared_module('printbackend-lpr',
'gtkprintbackendlpr.c',
c_args: printbackends_args,
dependencies: libgtk_dep,
install_dir: printbackends_install_dir,
install : true)
sources: 'gtkprintbackendlpr.c',
c_args: printbackends_args,
dependencies: libgtk_dep,
install_dir: printbackends_install_dir,
install: true,
)
endif
rest_dep = dependency('rest-0.7', required : get_option('print-cloudprint'))
@ -53,20 +57,23 @@ json_glib_dep = dependency('json-glib-1.0', required : get_option('print-cloudpr
if rest_dep.found() and json_glib_dep.found()
print_backends += 'cloudprint'
shared_module('printbackend-cloudprint',
'gtkprintbackendcloudprint.c',
'gtkprintercloudprint.c',
'gtkcloudprintaccount.c',
c_args: printbackends_args,
dependencies: [ libgtk_dep, rest_dep, json_glib_dep ],
install_dir: printbackends_install_dir,
install : true)
sources: [
'gtkprintbackendcloudprint.c',
'gtkprintercloudprint.c',
'gtkcloudprintaccount.c',
],
c_args: printbackends_args,
dependencies: [ libgtk_dep, rest_dep, json_glib_dep ],
install_dir: printbackends_install_dir,
install: true)
endif
# The 'file' print backend cannot be disabled
print_backends += 'file'
shared_module('printbackend-file',
'gtkprintbackendfile.c',
c_args: printbackends_args,
dependencies: libgtk_dep,
install_dir: printbackends_install_dir,
install : true)
sources: 'gtkprintbackendfile.c',
c_args: printbackends_args,
dependencies: libgtk_dep,
install_dir: printbackends_install_dir,
install: true,
)

View File

@ -131,13 +131,17 @@ test_args = ['-DGTK_SRCDIR="@0@"'.format(meson.current_source_dir())]
foreach t: gtk_tests
test_name = t.get(0)
test_srcs = ['@0@.c'.format(test_name), t.get(1, [])]
executable(test_name, test_srcs,
include_directories: [confinc, gdkinc],
c_args: test_args + common_cflags,
dependencies: [libgtk_dep, libm])
executable(test_name,
sources: test_srcs,
include_directories: [confinc, gdkinc],
c_args: test_args + common_cflags,
dependencies: [libgtk_dep, libm],
)
endforeach
if profiler_enabled
executable('testperf', 'testperf.c',
dependencies: [libsysprof_dep, platform_gio_dep, libm])
executable('testperf',
sources: 'testperf.c',
dependencies: [libsysprof_dep, platform_gio_dep, libm],
)
endif

View File

@ -81,11 +81,11 @@ foreach t : tests
endif
test(test_name, test_exe,
args: [ '--tap', '-k' ],
protocol: 'tap',
timeout: test_timeout,
env: test_env,
suite: ['a11y'] + test_extra_suites,
should_fail: expect_fail,
args: [ '--tap', '-k' ],
protocol: 'tap',
timeout: test_timeout,
env: test_env,
suite: ['a11y'] + test_extra_suites,
should_fail: expect_fail,
)
endforeach

View File

@ -16,35 +16,42 @@ testexecdir = join_paths(installed_test_bindir, 'css')
testdatadir = join_paths(installed_test_datadir, 'css')
test_api = executable('api', 'api.c',
c_args: common_cflags,
dependencies: libgtk_dep,
install: get_option('install-tests'),
install_dir: testexecdir)
c_args: common_cflags,
dependencies: libgtk_dep,
install: get_option('install-tests'),
install_dir: testexecdir,
)
test('api', test_api,
args: ['--tap', '-k' ],
protocol: 'tap',
env: csstest_env,
suite: 'css')
args: ['--tap', '-k' ],
protocol: 'tap',
env: csstest_env,
suite: 'css',
)
test_data = executable('data', ['data.c', '../../gtk/css/gtkcssdataurl.c'],
c_args: common_cflags,
include_directories: [confinc, ],
dependencies: gtk_deps,
install: get_option('install-tests'),
install_dir: testexecdir)
c_args: common_cflags,
include_directories: [confinc, ],
dependencies: gtk_deps,
install: get_option('install-tests'),
install_dir: testexecdir,
)
test('data', test_data,
args: ['--tap', '-k' ],
protocol: 'tap',
env: csstest_env,
suite: 'css')
args: ['--tap', '-k' ],
protocol: 'tap',
env: csstest_env,
suite: 'css',
)
if get_option('install-tests')
conf = configuration_data()
conf.set('libexecdir', gtk_libexecdir)
configure_file(input: 'api.test.in',
output: 'api.test',
configuration: conf,
install_dir: testdatadir)
output: 'api.test',
configuration: conf,
install_dir: testdatadir,
)
endif
if false and get_option ('profiler')
@ -52,21 +59,26 @@ if false and get_option ('profiler')
adwaita_env = csstest_env
adwaita_env.set('GTK_THEME', 'Adwaita')
test('performance-adwaita', test_performance,
args: [ '--mark', 'css validation',
'--name', 'performance-adwaita',
'--output', join_paths(meson.current_build_dir(), 'output'),
join_paths(meson.current_build_dir(), '../../demos/widget-factory/gtk4-widget-factory') ],
env: adwaita_env,
suite: [ 'css' ])
args: [
'--mark', 'css validation',
'--name', 'performance-adwaita',
'--output', join_paths(meson.current_build_dir(), 'output'),
join_paths(meson.current_build_dir(), '../../demos/widget-factory/gtk4-widget-factory'),
],
env: adwaita_env,
suite: [ 'css' ],
)
empty_env = csstest_env
empty_env.set('GTK_THEME', 'Empty')
test('performance-empty', test_performance,
args: [ '--mark', 'css validation',
'--name', 'performance-empty',
'--output', join_paths(meson.current_build_dir(), 'output'),
join_paths(meson.current_build_dir(), '../../demos/widget-factory/gtk4-widget-factory') ],
env: empty_env,
suite: [ 'css' ])
args: [
'--mark', 'css validation',
'--name', 'performance-empty',
'--output', join_paths(meson.current_build_dir(), 'output'),
join_paths(meson.current_build_dir(), '../../demos/widget-factory/gtk4-widget-factory'),
],
env: empty_env,
suite: [ 'css' ],
)
endif

View File

@ -96,16 +96,19 @@ foreach renderer : renderers
if ((renderer[1] == '' or not test.contains(renderer[1])) and
(renderer[0] != 'broadway' or broadway_enabled))
test(renderer[0] + ' ' + test, compare_render,
args: ['--output', join_paths(meson.current_build_dir(), 'compare', renderer[0]),
join_paths(meson.current_source_dir(), 'compare', test + '.node'),
join_paths(meson.current_source_dir(), 'compare', test + '.png')],
env: [
'GSK_RENDERER=' + renderer[0],
'GTK_A11Y=test',
'G_TEST_SRCDIR=@0@'.format(meson.current_source_dir()),
'G_TEST_BUILDDIR=@0@'.format(meson.current_build_dir())
],
suite: [ 'gsk', 'gsk-compare', 'gsk-' + renderer[0], 'gsk-compare-' + renderer[0] ])
args: [
'--output', join_paths(meson.current_build_dir(), 'compare', renderer[0]),
join_paths(meson.current_source_dir(), 'compare', test + '.node'),
join_paths(meson.current_source_dir(), 'compare', test + '.png'),
],
env: [
'GSK_RENDERER=' + renderer[0],
'GTK_A11Y=test',
'G_TEST_SRCDIR=@0@'.format(meson.current_source_dir()),
'G_TEST_BUILDDIR=@0@'.format(meson.current_build_dir())
],
suite: [ 'gsk', 'gsk-compare', 'gsk-' + renderer[0], 'gsk-compare-' + renderer[0] ],
)
endif
endforeach
endforeach
@ -175,15 +178,17 @@ node_parser_tests = [
foreach test : node_parser_tests
if test.endswith('.node') and not test.endswith('.ref.node')
test('parser ' + test, node_parser,
args: [ join_paths(meson.current_source_dir(), 'nodeparser', test)
],
env: [
'GSK_RENDERER=opengl',
'GTK_A11Y=test',
'G_TEST_SRCDIR=@0@'.format(meson.current_source_dir()),
'G_TEST_BUILDDIR=@0@'.format(meson.current_build_dir())
],
suite: 'gsk')
args: [
join_paths(meson.current_source_dir(), 'nodeparser', test)
],
env: [
'GSK_RENDERER=opengl',
'GTK_A11Y=test',
'G_TEST_SRCDIR=@0@'.format(meson.current_source_dir()),
'G_TEST_BUILDDIR=@0@'.format(meson.current_build_dir())
],
suite: 'gsk',
)
endif
endforeach
@ -206,16 +211,18 @@ foreach t : tests
link_args : test_extra_ldflags,
dependencies : libgtk_dep,
install: get_option('install-tests'),
install_dir: testexecdir)
install_dir: testexecdir,
)
test(test_name, test_exe,
args: [ '--tap', '-k' ],
protocol: 'tap',
env: [
'GSK_RENDERER=cairo',
'GTK_A11Y=test',
'G_TEST_SRCDIR=@0@'.format(meson.current_source_dir()),
'G_TEST_BUILDDIR=@0@'.format(meson.current_build_dir())
],
suite: 'gsk')
args: [ '--tap', '-k' ],
protocol: 'tap',
env: [
'GSK_RENDERER=cairo',
'GTK_A11Y=test',
'G_TEST_SRCDIR=@0@'.format(meson.current_source_dir()),
'G_TEST_BUILDDIR=@0@'.format(meson.current_build_dir())
],
suite: 'gsk',
)
endforeach

View File

@ -174,12 +174,14 @@ foreach t : tests
test_extra_suites = t.get('suites', [])
test_timeout = 60
test_exe = executable(test_name, test_srcs,
c_args : test_cargs + test_extra_cargs,
link_args : test_extra_ldflags,
dependencies : libgtk_dep,
test_exe = executable(test_name,
sources: test_srcs,
c_args: test_cargs + test_extra_cargs,
link_args: test_extra_ldflags,
dependencies: libgtk_dep,
install: get_option('install-tests'),
install_dir: testexecdir)
install_dir: testexecdir,
)
expect_fail = xfail.contains(test_name)
@ -188,36 +190,39 @@ foreach t : tests
endif
test(test_name, test_exe,
args: [ '--tap', '-k' ],
protocol: 'tap',
timeout: test_timeout,
env: test_env,
suite: ['gtk'] + test_extra_suites,
should_fail: expect_fail,
args: [ '--tap', '-k' ],
protocol: 'tap',
timeout: test_timeout,
env: test_env,
suite: ['gtk'] + test_extra_suites,
should_fail: expect_fail,
)
endforeach
# FIXME: if objc autotestkeywords_CPPFLAGS += -DHAVE_OBJC=1 -x objective-c++
if add_languages('cpp', required: false)
if add_languages('cpp', required: false, native: false)
test_exe = executable('autotestkeywords',
'autotestkeywords.cc',
c_args : test_cargs + ['-Idummy-headers'],
dependencies : libgtk_dep,
install: get_option('install-tests'),
install_dir: testexecdir)
sources: 'autotestkeywords.cc',
c_args: test_cargs + ['-Idummy-headers'],
dependencies: libgtk_dep,
install: get_option('install-tests'),
install_dir: testexecdir,
)
test('c++ keywords', test_exe,
args: [ '--tap', '-k' ],
#protocol: 'tap',
env: test_env,
suite: 'gtk')
args: [ '--tap', '-k' ],
#protocol: 'tap',
env: test_env,
suite: 'gtk',
)
if get_option('install-tests')
conf = configuration_data()
conf.set('testexecdir', testexecdir)
conf.set('test', 'autotestkeywords')
configure_file(input: 'gtk.test.in',
output: 'autotestkeywords.test',
configuration: conf,
install_dir: testdatadir)
output: 'autotestkeywords.test',
configuration: conf,
install_dir: testdatadir,
)
endif
endif
@ -245,7 +250,7 @@ focus_chain_tests = [
focus_chain = executable(
'test-focus-chain',
['test-focus-chain.c'],
sources: ['test-focus-chain.c'],
dependencies: libgtk_dep,
c_args: common_cflags,
install: get_option('install-tests'),
@ -254,10 +259,13 @@ focus_chain = executable(
foreach test : focus_chain_tests
test(test[0] + ' ' + test[1], focus_chain,
args: [ join_paths(meson.current_source_dir(), 'focus-chain', test[0] + '.ui'),
join_paths(meson.current_source_dir(), 'focus-chain', test[0] + '.' + test[1]) ],
env: test_env,
suite: [ 'gtk', 'focus' ])
args: [
join_paths(meson.current_source_dir(), 'focus-chain', test[0] + '.ui'),
join_paths(meson.current_source_dir(), 'focus-chain', test[0] + '.' + test[1]),
],
env: test_env,
suite: [ 'gtk', 'focus' ],
)
endforeach
@ -268,15 +276,15 @@ if get_option('install-tests')
conf.set('testexecdir', testexecdir)
conf.set('test', test_name)
configure_file(input: 'gtk.test.in',
output: '@0@.test'.format(test_name),
configuration: conf,
install_dir: testdatadir)
output: '@0@.test'.format(test_name),
configuration: conf,
install_dir: testdatadir,
)
endforeach
install_subdir('icons', install_dir: testexecdir)
install_subdir('icons2', install_dir: testexecdir)
install_subdir('ui', install_dir: testexecdir)
endif
if false and get_option ('profiler')
@ -285,13 +293,20 @@ if false and get_option ('profiler')
performance_env.set('GTK_THEME', 'Empty')
test('performance-layout', test_performance,
args: [ '--mark', 'size allocation', join_paths(meson.current_build_dir(), '../../demos/widget-factory/gtk4-widget-factory') ],
env: performance_env,
suite: [ 'gtk' ])
args: [
'--mark', 'size allocation',
join_paths(meson.current_build_dir(), '../../demos/widget-factory/gtk4-widget-factory'),
],
env: performance_env,
suite: [ 'gtk' ],
)
test('performance-snapshot', test_performance,
args: [ '--mark', 'widget snapshot', join_paths(meson.current_build_dir(), '../../demos/widget-factory/gtk4-widget-factory') ],
env: performance_end,
suite: [ 'gtk' ])
args: [
'--mark', 'widget snapshot',
join_paths(meson.current_build_dir(), '../../demos/widget-factory/gtk4-widget-factory'),
],
env: performance_env,
suite: [ 'gtk' ],
)
endif

View File

@ -1,7 +1,9 @@
if profiler_enabled
if libsysprof_dep.found()
test_performance = executable('test-performance', 'test-performance.c',
c_args: common_cflags,
dependencies: [libsysprof_dep, platform_gio_dep, libm])
test_performance = executable('test-performance',
sources: 'test-performance.c',
c_args: common_cflags,
dependencies: [libsysprof_dep, platform_gio_dep, libm],
)
endif
endif

View File

@ -9,12 +9,13 @@ endforeach
libgtkreftestprivate = library('gtkreftestprivate',
'reftest-compare.c', 'reftest-module.c', 'reftest-snapshot.c',
dependencies : libgtk_dep,
sources: [ 'reftest-compare.c', 'reftest-module.c', 'reftest-snapshot.c', ],
dependencies: libgtk_dep,
c_args: reftest_cflags)
libreftest = library('reftest',
[ 'expand-expander.c',
sources: [
'expand-expander.c',
'frame-inhibitor.c',
'letter-spacing.c',
'set-default-direction.c',
@ -37,12 +38,15 @@ tcdata.set('libexecdir', join_paths(get_option('prefix'), get_option('libexecdir
# configuration : tcdata)
#endforeach
gtk_reftest = executable('gtk-reftest', 'gtk-reftest.c',
gtk_reftest = executable('gtk-reftest',
sources: 'gtk-reftest.c',
c_args: common_cflags,
link_with : [libgtkreftestprivate, libreftest],
dependencies : libgtk_dep)
dependencies : libgtk_dep,
)
image_compare = executable('image-compare', 'image-compare.c',
image_compare = executable('image-compare',
sources: 'image-compare.c',
c_args: common_cflags,
link_with : [libgtkreftestprivate, libreftest],
dependencies : libgtk_dep)
@ -467,15 +471,17 @@ reftest_env.set('REFTEST_MODULE_DIR', meson.current_build_dir())
foreach testname : testdata
if testname.endswith('.ui') and not testname.endswith('.ref.ui')
test('reftest ' + testname, gtk_reftest,
args: [ '--tap',
'-k',
'-o', join_paths(meson.current_build_dir(), 'output'),
join_paths(meson.current_source_dir(), testname),
],
protocol: 'tap',
env: reftest_env,
suite: 'reftest',
should_fail: xfails.contains(testname))
args: [
'--tap',
'-k',
'-o', join_paths(meson.current_build_dir(), 'output'),
join_paths(meson.current_source_dir(), testname),
],
protocol: 'tap',
env: reftest_env,
suite: 'reftest',
should_fail: xfails.contains(testname),
)
endif
endforeach

View File

@ -8,26 +8,29 @@ if bash.found()
foreach t : ['simplify', 'simplify-3to4', 'validate', 'settings']
if get_option('install-tests')
configure_file(output: t,
input: '@0@.in'.format(t),
copy: true,
install_dir: testexecdir)
input: '@0@.in'.format(t),
copy: true,
install_dir: testexecdir,
)
else
configure_file(output: t,
input: '@0@.in'.format(t),
copy: true)
input: '@0@.in'.format(t),
copy: true,
)
endif
test(t, bash,
args: t,
workdir: meson.current_build_dir(),
protocol: 'tap',
env: [
'G_TEST_SRCDIR=@0@'.format(meson.current_source_dir()),
'G_TEST_BUILDDIR=@0@'.format(meson.current_build_dir()),
'GTK_A11Y=test',
'GTK_BUILDER_TOOL=@0@'.format(get_variable('gtk4_builder_tool').full_path()),
'GTK_QUERY_SETTINGS=@0@'.format(get_variable('gtk4_query_settings').full_path())
],
suite: 'tools')
args: t,
workdir: meson.current_build_dir(),
protocol: 'tap',
env: [
'G_TEST_SRCDIR=@0@'.format(meson.current_source_dir()),
'G_TEST_BUILDDIR=@0@'.format(meson.current_build_dir()),
'GTK_A11Y=test',
'GTK_BUILDER_TOOL=@0@'.format(get_variable('gtk4_builder_tool').full_path()),
'GTK_QUERY_SETTINGS=@0@'.format(get_variable('gtk4_query_settings').full_path())
],
suite: 'tools',
)
endforeach
endif
@ -37,9 +40,10 @@ if get_option('install-tests')
test_conf.set('testexecdir', testexecdir)
test_conf.set('test', t)
configure_file(output: '@0@.test'.format(t),
input: 'tools.test.in',
configuration: test_conf,
install_dir: testdatadir)
input: 'tools.test.in',
configuration: test_conf,
install_dir: testdatadir,
)
endforeach
install_subdir('simplify-data', install_dir: testexecdir)