diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 99f32fdf..5ff73b33 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -42,11 +42,11 @@ jobs: strategy: matrix: configureFlags: - - "-Dintrospection=false -Dglib=disabled" - - "-Dglib=disabled" + - "" + - "-Dglib=enabled -Dintrospection=enabled" - "-Dgegl=enabled" include: - - configureFlags: "-Dglib=enabled" + - configureFlags: "-Dglib=enabled -Dintrospection=enabled" extraDeps: "libgirepository1.0-dev" - configureFlags: "-Dgegl=enabled" extraDeps: "libgegl-dev" diff --git a/gegl/meson.build b/gegl/meson.build index de01cae3..fc4adc31 100644 --- a/gegl/meson.build +++ b/gegl/meson.build @@ -30,7 +30,7 @@ install_headers( ) -if get_option('introspection') +if use_introspection gnome = import('gnome') libmypaint_gegl_gir = gnome.generate_gir( diff --git a/meson.build b/meson.build index 01db1753..33cb3ab5 100644 --- a/meson.build +++ b/meson.build @@ -93,6 +93,20 @@ if use_gegl endif introspection_required_version = '1.32.0' +introspection_feature = get_option( + 'introspection', +).require( + use_glib, + error_message: 'Generating GObject introspection requires building with GLib support', +) +# For g-ir-scanner and g-ir-compiler as used by the gnome module. +gi = dependency( + 'gobject-introspection-1.0', + version: f'>=@introspection_required_version@', + required: introspection_feature, + native: true, +) +use_introspection = gi.found() # OpenMP @@ -235,11 +249,7 @@ libmypaint = library( install: true, ) - -if get_option('introspection') - if not use_glib - error('Generating GObject introspection requires building with GLib support') - endif +if use_introspection gnome = import('gnome') libmypaint_gir = gnome.generate_gir( diff --git a/meson_options.txt b/meson_options.txt index 2c2ae86f..394187a9 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -44,7 +44,7 @@ option( ) option( 'introspection', - type: 'boolean', - value: true, - description: 'Enable GObject Instrospection', + type: 'feature', + value: 'auto', + description: 'Enable GObject Instrospection (requires glib feature)', )