From 6dd222e753f8313e40d8945d341b79668c8016c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Date: Mon, 24 Oct 2022 14:13:04 +0200 Subject: [PATCH] meson: Cleanup include-dir paths, use base path without repetitions Avoid setting the subdir all the times, just use the global definition plus the specific module subdir --- gio/meson.build | 10 ++++++---- glib/meson.build | 10 ++++++---- gmodule/meson.build | 6 ++++-- gobject/meson.build | 6 ++++-- meson.build | 4 ++-- 5 files changed, 22 insertions(+), 14 deletions(-) diff --git a/gio/meson.build b/gio/meson.build index 4cec90914..31c4dddbb 100644 --- a/gio/meson.build +++ b/gio/meson.build @@ -9,6 +9,8 @@ gio_c_args_internal = [ '-DGIO_COMPILATION', ] +gio_includedir = glib_includedir / 'gio' + # FIXME: Install empty glib_giomodulesdir gnetworking_h_conf = configuration_data() @@ -169,7 +171,7 @@ gnetworking_h_conf.set('NAMESER_COMPAT_INCLUDE', gnetworking_h_nameser_compat_in gnetworking_h = configure_file(input : 'gnetworking.h.in', output : 'gnetworking.h', - install_dir : join_paths(get_option('includedir'), 'glib-2.0/gio'), + install_dir : gio_includedir, configuration : gnetworking_h_conf) gdbus_headers = files( @@ -747,7 +749,7 @@ gvisibility_h = custom_target( output: 'gio-visibility.h', command: [gen_visibility_macros, meson.project_version(), 'visibility-macros', 'GIO', '@OUTPUT@'], install: true, - install_dir: glib_includedir / 'gio', + install_dir: gio_includedir, install_tag : 'devel', ) gio_sources += gvisibility_h @@ -755,7 +757,7 @@ gio_sources += gvisibility_h gio_headers += application_headers gio_headers += settings_headers gio_headers += gdbus_headers -install_headers(gio_headers, subdir : 'glib-2.0/gio/') +install_headers(gio_headers, install_dir : gio_includedir) # We can't use gnome.mkenums() because the GNOME module looks for glib-mkenums # in PATH, which means you can't bootstrap glib with its own glib-mkenums. @@ -764,7 +766,7 @@ gioenumtypes_h = custom_target('gioenumtypes_h', capture : true, input : gio_headers, install : true, - install_dir : join_paths(get_option('includedir'), 'glib-2.0/gio'), + install_dir : gio_includedir, command : [python, glib_mkenums, '--template', files('gioenumtypes.h.template'), '@INPUT@', gnetworking_h]) diff --git a/glib/meson.build b/glib/meson.build index c93d53014..d5a0962dd 100644 --- a/glib/meson.build +++ b/glib/meson.build @@ -1,4 +1,5 @@ glib_sources = [] +glib_sub_includedir = glib_includedir / 'glib' glibconfig_h = configure_file(input : 'glibconfig.h.in', output : 'glibconfig.h', install_dir : join_paths(get_option('libdir'), 'glib-2.0/include'), @@ -19,7 +20,7 @@ gvisibility_h = custom_target( output: 'glib-visibility.h', command: [gen_visibility_macros, meson.project_version(), 'visibility-macros', 'GLIB', '@OUTPUT@'], install: true, - install_dir: glib_includedir / 'glib', + install_dir: glib_sub_includedir, install_tag : 'devel', ) @@ -146,7 +147,7 @@ glib_headers = files( 'glib-unix.h', 'glib-object.h', ) -install_headers(glib_headers, subdir : 'glib-2.0') +install_headers(glib_headers, install_dir : glib_includedir) # Expose as variable to be used by gobject-introspection # when it includes GLib as a subproject @@ -160,7 +161,8 @@ glib_deprecated_headers = files( 'deprecated/grel.h', 'deprecated/gthread.h', ) -install_headers(glib_deprecated_headers, subdir : 'glib-2.0/glib/deprecated') +install_headers(glib_deprecated_headers, + install_dir : glib_sub_includedir / 'deprecated') glib_sub_headers = files( 'glib-autocleanups.h', @@ -243,7 +245,7 @@ glib_sub_headers = files( 'gprintf.h', ) -install_headers(glib_sub_headers, subdir : 'glib-2.0/glib') +install_headers(glib_sub_headers, install_dir : glib_sub_includedir) deprecated_sources = files( 'deprecated/gallocator.c', diff --git a/gmodule/meson.build b/gmodule/meson.build index 0c5d7f89a..7ca10a529 100644 --- a/gmodule/meson.build +++ b/gmodule/meson.build @@ -6,6 +6,8 @@ g_module_have_dlerror = 0 g_module_impl = '' +g_module_includedir = glib_includedir / 'gmodule' + # On Windows force native WIN32 shared lib loader if host_system == 'windows' g_module_impl = 'G_MODULE_IMPL_WIN32' @@ -64,13 +66,13 @@ gmoduleconf_h = configure_file(input : 'gmoduleconf.h.in', gmodule_h = files('gmodule.h') gmodule_c = files('gmodule.c') -install_headers([gmodule_h], subdir : 'glib-2.0') +install_headers([gmodule_h], install_dir : glib_includedir) gvisibility_h = custom_target( output: 'gmodule-visibility.h', command: [gen_visibility_macros, meson.project_version(), 'visibility-macros', 'GMODULE', '@OUTPUT@'], install: true, - install_dir: glib_includedir / 'gmodule', + install_dir: g_module_includedir, install_tag : 'devel', ) diff --git a/gobject/meson.build b/gobject/meson.build index 2c1981612..89b6c04cd 100644 --- a/gobject/meson.build +++ b/gobject/meson.build @@ -1,3 +1,5 @@ +gobject_includedir = glib_includedir / 'gobject' + gobject_install_headers = files( 'gobject-autocleanups.h', 'glib-types.h', @@ -29,12 +31,12 @@ gvisibility_h = custom_target( output: 'gobject-visibility.h', command: [gen_visibility_macros, meson.project_version(), 'visibility-macros', 'GOBJECT', '@OUTPUT@'], install: true, - install_dir: glib_includedir / 'gobject', + install_dir: gobject_includedir, install_tag : 'devel', ) gobject_sources += gvisibility_h -install_headers(gobject_install_headers, subdir : 'glib-2.0/gobject') +install_headers(gobject_install_headers, install_dir : gobject_includedir) gobject_sources += files( 'gatomicarray.c', diff --git a/meson.build b/meson.build index 237214442..e93ed2c8d 100644 --- a/meson.build +++ b/meson.build @@ -83,7 +83,7 @@ glib_libdir = join_paths(glib_prefix, get_option('libdir')) glib_libexecdir = join_paths(glib_prefix, get_option('libexecdir')) glib_datadir = join_paths(glib_prefix, get_option('datadir')) glib_pkgdatadir = join_paths(glib_datadir, 'glib-2.0') -glib_includedir = join_paths(glib_prefix, get_option('includedir')) +glib_includedir = join_paths(glib_prefix, get_option('includedir'), 'glib-2.0') if get_option('gio_module_dir') != '' glib_giomodulesdir = join_paths(glib_prefix, get_option('gio_module_dir')) else @@ -2364,7 +2364,7 @@ install_data('m4macros/glib-2.0.m4', 'm4macros/glib-gettext.m4', 'm4macros/gsett configure_file(output : 'config.h', configuration : glib_conf) if host_system == 'windows' - install_headers([ 'msvc_recommended_pragmas.h' ], subdir : 'glib-2.0') + install_headers([ 'msvc_recommended_pragmas.h' ], install_dir : glib_includedir) endif if get_option('man')