Skip to content

Commit 584599e

Browse files
committed
fixup! Add meson build system
Use auto feature for introspection.
1 parent 8af70db commit 584599e

File tree

4 files changed

+22
-12
lines changed

4 files changed

+22
-12
lines changed

.github/workflows/test.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,11 @@ jobs:
4242
strategy:
4343
matrix:
4444
configureFlags:
45-
- "-Dintrospection=false -Dglib=disabled"
46-
- "-Dglib=disabled"
45+
- ""
46+
- "-Dglib=enabled -Dintrospection=enabled"
4747
- "-Dgegl=enabled"
4848
include:
49-
- configureFlags: "-Dglib=enabled"
49+
- configureFlags: "-Dglib=enabled -Dintrospection=enabled"
5050
extraDeps: "libgirepository1.0-dev"
5151
- configureFlags: "-Dgegl=enabled"
5252
extraDeps: "libgegl-dev"

gegl/meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ install_headers(
3030
)
3131

3232

33-
if get_option('introspection')
33+
if use_introspection
3434
gnome = import('gnome')
3535

3636
libmypaint_gegl_gir = gnome.generate_gir(

meson.build

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,20 @@ if use_gegl
9393
endif
9494

9595
introspection_required_version = '1.32.0'
96+
introspection_feature = get_option(
97+
'introspection',
98+
).require(
99+
use_glib,
100+
error_message: 'Generating GObject introspection requires building with GLib support',
101+
)
102+
# For g-ir-scanner and g-ir-compiler as used by the gnome module.
103+
gi = dependency(
104+
'gobject-introspection-1.0',
105+
version: f'>=@introspection_required_version@',
106+
required: introspection_feature,
107+
native: true,
108+
)
109+
use_introspection = gi.found()
96110

97111

98112
# OpenMP
@@ -235,11 +249,7 @@ libmypaint = library(
235249
install: true,
236250
)
237251

238-
239-
if get_option('introspection')
240-
if not use_glib
241-
error('Generating GObject introspection requires building with GLib support')
242-
endif
252+
if use_introspection
243253
gnome = import('gnome')
244254

245255
libmypaint_gir = gnome.generate_gir(

meson_options.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ option(
4444
)
4545
option(
4646
'introspection',
47-
type: 'boolean',
48-
value: true,
49-
description: 'Enable GObject Instrospection',
47+
type: 'feature',
48+
value: 'auto',
49+
description: 'Enable GObject Instrospection (requires glib feature)',
5050
)

0 commit comments

Comments
 (0)