build: Install gtkconfig.h header

With GTK_ACCESSIBILITY_ATSPI as its sole define for now. This will
allow clients to conditionally include gtk/a11y/gtkatspi.h if they
need to use the AT-SPI specific functions.
This commit is contained in:
Georges Basile Stavracas Neto
2024-01-23 10:11:05 -03:00
parent ead1b36afd
commit afbd7cfe55
3 changed files with 30 additions and 1 deletions

View File

@@ -92,6 +92,7 @@
#include <gtk/gtkcolumnviewsorter.h>
#include <gtk/deprecated/gtkcombobox.h>
#include <gtk/deprecated/gtkcomboboxtext.h>
#include <gtk/gtkconfig.h>
#include <gtk/gtkconstraintlayout.h>
#include <gtk/gtkconstraint.h>
#include <gtk/gtkcssprovider.h>

16
gtk/gtkconfig.h.meson Normal file
View File

@@ -0,0 +1,16 @@
#ifndef __GTKCONFIG_H__
#define __GTKCONFIG_H__
#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
#error "Only <gtk/gtk.h> can be included directly."
#endif
#include <glib.h>
G_BEGIN_DECLS
#mesondefine GTK_ACCESSIBILITY_ATSPI
G_END_DECLS
#endif /* __GTKCONFIG_H__ */

View File

@@ -970,6 +970,16 @@ else
)
endif
gtkconfig_cdata = configuration_data()
gtkconfig_cdata.set('GTK_ACCESSIBILITY_ATSPI', gtk_a11y_backends.contains('atspi'))
gtkconfig = configure_file(
input: 'gtkconfig.h.meson',
output: 'gtkconfig.h',
configuration: gtkconfig_cdata,
install_dir: gtk_includedir / 'gtk-4.0/gtk',
)
gtkversion_cdata = configuration_data()
gtkversion_cdata.set('GTK_MAJOR_VERSION', gtk_major_version)
gtkversion_cdata.set('GTK_MINOR_VERSION', gtk_minor_version)
@@ -996,6 +1006,7 @@ gtk_gen_headers = [
gtkmarshal_h,
gtktypebuiltins_h,
gtkprivatetypebuiltins_h,
gtkconfig,
gtkversion,
]
@@ -1151,7 +1162,7 @@ libgtk = shared_library('gtk-4',
install: true,
)
gtk_dep_sources = [gtkversion, gtktypebuiltins_h]
gtk_dep_sources = [gtkconfig, gtkversion, gtktypebuiltins_h]
# Introspection
if build_gir
@@ -1260,6 +1271,7 @@ if build_gir
gtk_deprecated_sources,
gtktypebuiltins_h,
gtkversion,
gtkconfig,
]
if os_unix