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
This commit is contained in:
Marco Trevisan (Treviño) 2022-10-24 14:13:04 +02:00
parent 8fe2e4d364
commit 6dd222e753
5 changed files with 22 additions and 14 deletions

View File

@ -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])

View File

@ -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',

View File

@ -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',
)

View File

@ -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',

View File

@ -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')