From 0e5dac8c25d11e3ce921c584c05064a93507393d Mon Sep 17 00:00:00 2001 From: Xavier Claessens Date: Wed, 30 Sep 2020 09:41:28 -0400 Subject: [PATCH] meson: Change introspection option to yielding feature Yielding option means that if pango is built as a subproject, it will take the value of that option from the parent project (e.g. gst-build). For that to work it must be of the same type, which is "feature" instead of "boolean" in all GStreamer modules. --- .gitlab-ci.yml | 2 +- .gitlab-ci/flatpak-build.sh | 2 +- .gitlab-ci/test-msys2.sh | 2 +- gtk/meson.build | 5 ++++- meson.build | 2 +- meson_options.txt | 5 +++-- 6 files changed, 11 insertions(+), 7 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 832880d617..2f425ca327 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -223,7 +223,7 @@ asan-build: needs: [] variables: script: - - CC=clang meson --buildtype=debugoptimized -Db_sanitize=address -Db_lundef=false -Dintrospection=false _build + - CC=clang meson --buildtype=debugoptimized -Db_sanitize=address -Db_lundef=false -Dintrospection=disabled _build - ninja -C _build - .gitlab-ci/run-tests.sh _build wayland artifacts: diff --git a/.gitlab-ci/flatpak-build.sh b/.gitlab-ci/flatpak-build.sh index cbb6c097d1..531741db1d 100644 --- a/.gitlab-ci/flatpak-build.sh +++ b/.gitlab-ci/flatpak-build.sh @@ -22,7 +22,7 @@ flatpak build ${builddir} meson \ -Dprint-backends=file \ -Dbuild-tests=false \ -Dbuild-examples=false \ - -Dintrospection=false \ + -Dintrospection=disabled \ -Ddemos=true \ _flatpak_build diff --git a/.gitlab-ci/test-msys2.sh b/.gitlab-ci/test-msys2.sh index d311f4bbe7..dfa8813240 100644 --- a/.gitlab-ci/test-msys2.sh +++ b/.gitlab-ci/test-msys2.sh @@ -67,7 +67,7 @@ meson \ -Dwayland-backend=false \ -Dwin32-backend=true \ -Dvulkan=disabled \ - -Dintrospection=false \ + -Dintrospection=disabled \ -Dgtk:werror=true \ _build unset CCACHE_DISABLE diff --git a/gtk/meson.build b/gtk/meson.build index 3554c1b2f1..3e18f05cb6 100644 --- a/gtk/meson.build +++ b/gtk/meson.build @@ -1075,8 +1075,11 @@ libgtk = library('gtk-4', install: true) gtk_dep_sources = [gtkversion, gtktypebuiltins_h] + # Introspection -build_gir = get_option('introspection') +gir = find_program('g-ir-scanner', required : get_option('introspection')) +build_gir = gir.found() and (not meson.is_cross_build() or get_option('introspection').enabled()) + if build_gir gir_args = [ '-DGTK_COMPILATION', diff --git a/meson.build b/meson.build index 127671a349..6ad27d2158 100644 --- a/meson.build +++ b/meson.build @@ -876,7 +876,7 @@ summary('Tracker support', tracker3_dep.found(), section: 'Features') # Build summary('Debugging', get_option('debug'), section: 'Build') summary('Optimization', get_option('optimization'), section: 'Build') -summary('Introspection', get_option('introspection'), section: 'Build') +summary('Introspection', build_gir, section: 'Build') summary('Documentation', get_option('gtk_doc'), section: 'Build') summary('Man pages', get_option('man-pages'), section: 'Build') summary('Tests', get_option('build-tests'), section: 'Build') diff --git a/meson_options.txt b/meson_options.txt index f4dc3b43d7..b58c8a9fa0 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -84,8 +84,9 @@ option('man-pages', description : 'Build man pages for installed tools') option('introspection', - type: 'boolean', - value: 'true', + type: 'feature', + value: 'auto', + yield: true, description : 'Build introspection data (requires gobject-introspection)') # Demos, examples and tests