[introspection] Skip sources not usable with GObject Introspection

There is no point in generating GIR for code interfacing with libraries
without introspection integration. This fixes spurious warnings on macOS
when g-ir-scanner mistakenly tries to scan system headers.
This commit is contained in:
Khaled Hosny 2023-01-01 00:41:55 +02:00 committed by خالد حسني (Khaled Hosny)
parent 2bd09a99c1
commit 27684f14be
1 changed files with 13 additions and 8 deletions

View File

@ -431,6 +431,18 @@ if conf.get('HAVE_FREETYPE', 0) == 1
hb_features.set('HB_HAS_FREETYPE', 1)
endif
if conf.get('HAVE_GLIB', 0) == 1
hb_sources += hb_glib_sources
hb_headers += hb_glib_headers
harfbuzz_deps += [glib_dep]
hb_features.set('HB_HAS_GLIB', 1)
endif
# We set those here to not include the sources below that are of no use to
# GObject Introspection
gir_sources = hb_sources + hb_gobject_sources
gir_headers = hb_headers + hb_gobject_headers
if conf.get('HAVE_GDI', 0) == 1
hb_sources += hb_gdi_sources
hb_headers += hb_gdi_headers
@ -445,13 +457,6 @@ if conf.get('HAVE_GRAPHITE2', 0) == 1
hb_features.set('HB_HAS_GRAPHITE', 1)
endif
if conf.get('HAVE_GLIB', 0) == 1
hb_sources += hb_glib_sources
hb_headers += hb_glib_headers
harfbuzz_deps += [glib_dep]
hb_features.set('HB_HAS_GLIB', 1)
endif
if conf.get('HAVE_UNISCRIBE', 0) == 1
hb_sources += hb_uniscribe_sources
hb_headers += hb_uniscribe_headers
@ -816,7 +821,7 @@ if have_gobject
if build_gir
conf.set('HAVE_INTROSPECTION', 1)
hb_gen_files_gir = gnome.generate_gir(libharfbuzz_gobject,
sources: [hb_headers, hb_sources, hb_gobject_headers, hb_gobject_sources, enum_h],
sources: [gir_headers, gir_sources, enum_h],
dependencies: libharfbuzz_dep,
namespace: 'HarfBuzz',
nsversion: '0.0',