# HG changeset patch
# Node ID 989a578b43b3
# Parent  c7c9f38ec256
diff --git a/meson.build b/meson.build
--- a/meson.build
+++ b/meson.build
@@ -26,9 +26,9 @@
 # the first version for Finch 3 was 3.0.0
 
 project('libgnt', 'c',
-    license : 'GPL-2.0-or-later',
-    version : '3.0.0-devel',
-    meson_version : '>=0.50.0')
+	license : 'GPL-2.0-or-later',
+	version : '3.0.0-devel',
+	meson_version : '>=0.50.0')
 gnt_soversion = 1
 
 parts = meson.project_version().split('-')
@@ -83,7 +83,7 @@
 	foreach location : ncursesw_header_paths
 		f = location + 'ncurses.h'
 		if compiler.has_header_symbol(f, 'get_wch',
-		    prefix : '#define _XOPEN_SOURCE_EXTENDED')
+			prefix : '#define _XOPEN_SOURCE_EXTENDED')
 			ncurses_header = f
 		endif
 	endforeach
@@ -98,7 +98,7 @@
 		foreach location : ncursesw_header_paths
 			f = location + 'ncurses.h'
 			if compiler.has_header_symbol(f, 'get_wch',
-			    prefix : '#define _XOPEN_SOURCE_EXTENDED')
+				prefix : '#define _XOPEN_SOURCE_EXTENDED')
 				ncurses_available = true
 				ncurses_header = f
 			endif
@@ -106,8 +106,8 @@
 
 		if ncurses_available
 			ncurses = declare_dependency(
-			    include_directories : ncurses_inc,
-			    dependencies : ncurses_libs
+				include_directories : ncurses_inc,
+				dependencies : ncurses_libs
 			)
 		endif
 	endif
@@ -204,6 +204,8 @@
 	'gntws.h',
 ]
 
+libgnt_generated_targets = []
+
 # Check for Python headers
 _PYTHONS = [
 	['python-3.10-embed', '>=3.10'],
@@ -225,15 +227,15 @@
 gnt_config.set('USE_PYTHON', python_dep.found())
 
 configure_file(output : 'gntconfig.h',
-    configuration : gnt_config)
+	configuration : gnt_config)
 configure_file(input : 'gntversion.h.in', output : 'gntversion.h',
-    configuration : gnt_config,
-    install : true,
-    install_dir : get_option('includedir') / 'gnt3')
+	configuration : gnt_config,
+	install : true,
+	install_dir : get_option('includedir') / 'gnt3')
 gntncurses_h = configure_file(input : 'gntncurses.h.in', output : 'gntncurses.h',
-    configuration : gnt_config,
-    install : true,
-    install_dir : get_option('includedir') / 'gnt3')
+	configuration : gnt_config,
+	install : true,
+	install_dir : get_option('includedir') / 'gnt3')
 
 GNT_H_INCLUDES = []
 foreach header : libgnt_headers + ['gntncurses.h', 'gntversion.h']
@@ -242,9 +244,9 @@
 gnt_h_config = configuration_data()
 gnt_h_config.set('GNT_H_INCLUDES', '\n'.join(GNT_H_INCLUDES))
 gnt_h = configure_file(input : 'gnt.h.in', output : 'gnt.h',
-    configuration : gnt_h_config,
-    install : true,
-    install_dir : get_option('includedir') / 'gnt3')
+	configuration : gnt_h_config,
+	install : true,
+	install_dir : get_option('includedir') / 'gnt3')
 
 gmodule = dependency('gmodule-2.0')
 
@@ -253,55 +255,58 @@
 if host_machine.system() == 'windows'
 	windows = import('windows')
 	libgnt_winres = configure_file(
-	    input : 'libgnt_winres.rc.in',
-	    output : 'libgnt_winres.rc',
-	    configuration : gnt_config)
+		input : 'libgnt_winres.rc.in',
+		output : 'libgnt_winres.rc',
+		configuration : gnt_config)
 	libgnt_SOURCES += windows.compile_resources(libgnt_winres)
 endif
 
 libgnt_inc = include_directories('.')
 libgnt = library('gnt',
-                 libgnt_SOURCES,
-                 libgnt_headers,
-                 gnt_h,
-                 gntncurses_h,
-                 c_args : ['-DGNT_COMPILATION', '-DG_LOG_DOMAIN="Gnt"'],
-                 install : true,
-                 version : '@0@.@1@.@2@'.format(gnt_soversion,
-                                                gnt_minor_version,
-                                                gnt_micro_version),
-                 dependencies : [ncurses, libxml, glib, gobject, gmodule, python_dep])
+				 libgnt_SOURCES,
+				 libgnt_headers,
+				 gnt_h,
+				 gntncurses_h,
+				 c_args : ['-DGNT_COMPILATION', '-DG_LOG_DOMAIN="Gnt"'],
+				 install : true,
+				 version : '@0@.@1@.@2@'.format(gnt_soversion,
+				                                gnt_minor_version,
+				                                gnt_micro_version),
+				 dependencies : [ncurses, libxml, glib, gobject, gmodule, python_dep])
+
+pkgconfig.generate(
+	libgnt,
+	name : 'LibGNT',
+	description : 'Glib Ncurses Toolkit is a collection of curses-widgets.',
+	filebase : 'gnt3',
+	subdirs : 'gnt3',
+	requires : [glib],
+	variables : ['plugindir = ${libdir}/gnt3'],
+	)
+
+if get_option('introspection')
+	libgnt_gir = gnome.generate_gir(libgnt,
+		sources : libgnt_headers + [gnt_h],
+		includes : ['GLib-2.0', 'GObject-2.0'],
+		namespace : 'Gnt',
+		symbol_prefix : 'gnt',
+		identifier_prefix : 'Gnt',
+		nsversion : '@0@.@1@'.format(gnt_major_version, gnt_minor_version),
+		install : true,
+		extra_args : ['-DGNT_COMPILATION', '--quiet'])
+	libgnt_generated_targets += libgnt_gir
+endif
+
 libgnt_dep = declare_dependency(
-    include_directories : libgnt_inc,
-    link_with : libgnt,
-    dependencies : [ncurses, glib])
+	include_directories : libgnt_inc,
+	link_with : libgnt,
+	dependencies : [ncurses, glib],
+	sources : libgnt_generated_targets)
 
 if meson.version().version_compare('>=0.54.0')
 	meson.override_dependency('gnt3', libgnt_dep)
 endif
 
-pkgconfig.generate(
-    libgnt,
-    name : 'LibGNT',
-    description : 'Glib Ncurses Toolkit is a collection of curses-widgets.',
-    filebase : 'gnt3',
-    subdirs : 'gnt3',
-    requires : [glib],
-    variables : ['plugindir = ${libdir}/gnt3'],
-    )
-
-if get_option('introspection')
-	libgnt_gir = gnome.generate_gir(libgnt,
-	    sources : libgnt_headers + [gnt_h],
-	    includes : 'GObject-2.0',
-	    namespace : 'Gnt',
-	    symbol_prefix : 'gnt',
-	    identifier_prefix : 'Gnt',
-	    nsversion : '@0@.@1@'.format(gnt_major_version, gnt_minor_version),
-	    install : true,
-	    extra_args : ['-DGNT_COMPILATION', '--quiet'])
-endif
-
 subdir('wms')
 subdir('test')
 if get_option('doc')
