Skip to content

Commit

Permalink
meson: Change introspection option to yielding feature
Browse files Browse the repository at this point in the history
This copies the same logic as in GTK+. A yielding feature option has the
advantage that if introspection is disabled in GTK and graphene is built
as subproject it will inherit the value from GTK main project.
  • Loading branch information
xclaesse authored and ebassi committed Feb 9, 2021
1 parent 603d9f8 commit 41ebe5f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ using configuration options:
* `-Darm_neon=false` - will disable the ARM NEON fast paths
* `-Dgcc_vector=false` - will disable the GCC vector intrinsics

If you don't plan on generating introspection data, use `-Dintrospection=false`
If you don't plan on generating introspection data, use `-Dintrospection=disabled`
when configuring Graphene; similarly, if you don't plan on using GObject with
Graphene, use `-Dgobject_types=false`. Disabling GObject types will also
automatically disable generating introspection data.
Expand Down
8 changes: 7 additions & 1 deletion meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,13 @@ endif

# Optional dependency on GObject-Introspection; if GObject is disabled
# then we don't build introspection data either
build_gir = build_gobject and get_option('introspection') and get_option('default_library') == 'shared'
gir = find_program('g-ir-scanner', required : get_option('introspection'))
build_gir = build_gobject and gir.found()
# Disable g-i when cross compiling by default because it rarely works unless
# special care has been taken, in which case the user can enable the option.
if meson.is_cross_build() and not get_option('introspection').enabled()
build_gir = false
endif

# Check for InitOnce on Windows
if host_system == 'windows'
Expand Down
5 changes: 3 additions & 2 deletions meson_options.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ option('gtk_doc', type: 'boolean',
option('gobject_types', type: 'boolean',
value: true,
description: 'Enable GObject types (depends on GObject)')
option('introspection', type: 'boolean',
value: true,
option('introspection', type: 'feature',
value: 'auto',
yield: true,
description: 'Enable GObject Introspection (depends on GObject)')
option('gcc_vector', type: 'boolean',
value: true,
Expand Down

0 comments on commit 41ebe5f

Please sign in to comment.