From e02e1ed07abb1aadcd080f13a72545dc2a5d1260 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 | 8 +++++--- glib/meson.build | 9 ++++++--- gmodule/meson.build | 6 ++++-- gobject/meson.build | 4 +++- meson.build | 4 ++-- 5 files changed, 20 insertions(+), 11 deletions(-) diff --git a/gio/meson.build b/gio/meson.build index 33b46324e..2d366aca4 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( @@ -752,7 +754,7 @@ gio_headers += 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. @@ -761,7 +763,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 56adf8758..e42e16cb5 100644 --- a/glib/meson.build +++ b/glib/meson.build @@ -1,3 +1,5 @@ +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'), install_tag : 'devel', @@ -134,7 +136,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 @@ -148,7 +150,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', @@ -233,7 +236,7 @@ glib_sub_headers = files( glib_sub_headers += [gversionmacros_h, gvisibility_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 54b25a0c5..39a7cfda3 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 = configure_file( output: 'gmodule-visibility.h', command: [gen_visibility_macros, meson.project_version(), 'visibility-macros', 'GMODULE', '@OUTPUT@'], ) -install_headers(gvisibility_h, subdir : 'glib-2.0/gmodule') +install_headers(gvisibility_h, install_dir : g_module_includedir) gmodule_sources = [gmodule_c] if host_system == 'windows' diff --git a/gobject/meson.build b/gobject/meson.build index 09c07f306..ddc65205a 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', @@ -30,7 +32,7 @@ gvisibility_h = configure_file( gobject_install_headers += 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')