Skip to content

Commit

Permalink
fixup! Add meson build system
Browse files Browse the repository at this point in the history
Use auto feature for introspection.
  • Loading branch information
jtojnar committed Feb 6, 2024
1 parent 8af70db commit 584599e
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 12 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion gegl/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ install_headers(
)


if get_option('introspection')
if use_introspection
gnome = import('gnome')

libmypaint_gegl_gir = gnome.generate_gir(
Expand Down
20 changes: 15 additions & 5 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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(
Expand Down
6 changes: 3 additions & 3 deletions meson_options.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)',
)

0 comments on commit 584599e

Please sign in to comment.