build: Clean up handling of internal dependencies

We currently only specify the library to link with when declaring
a dependency, which means that satisfying other requirements like
dependencies or includes is left to the targets.

Move everything required by libshell/libst to the declared dependency,
so other targets only need to care about their own requirements.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3615>
This commit is contained in:
Florian Müllner 2025-01-23 05:13:25 +01:00 committed by Marge Bot
parent 0c20407f57
commit 6c47cea2b9
2 changed files with 22 additions and 13 deletions

View File

@ -238,7 +238,7 @@ endif
libshell = library('shell-' + mutter_api_version,
sources: libshell_gir_sources + libshell_no_gir_sources,
dependencies: gnome_shell_deps + [libshell_menu_dep, libst_dep, mutter_dep, gnome_desktop_dep, m_dep],
include_directories: [conf_inc, st_inc, include_directories('tray')],
include_directories: [conf_inc, include_directories('tray')],
c_args: gnome_shell_cflags,
link_with: libshell_link_with,
build_rpath: mutter_typelibdir,
@ -247,7 +247,11 @@ libshell = library('shell-' + mutter_api_version,
install: true
)
libshell_dep = declare_dependency(link_with: libshell)
libshell_dep = declare_dependency(
link_with: libshell,
dependencies: [libst_dep, mutter_dep],
include_directories: [include_directories('tray')],
)
libshell_gir_includes = [
'Clutter-@0@'.format(mutter_api_version),
@ -278,7 +282,7 @@ libshell_gir = gnome.generate_gir(libshell,
executable('gnome-shell', 'main.c',
c_args: gnome_shell_cflags + typelib_cflags,
dependencies: gnome_shell_deps + [libshell_dep, libst_dep, mutter_dep],
include_directories: [conf_inc, st_inc, include_directories('tray')],
include_directories: [conf_inc],
build_rpath: mutter_typelibdir,
install_rpath: install_rpath,
install: true
@ -303,9 +307,8 @@ executable('gnome-shell-perf-helper', 'shell-perf-helper.c', js_resources,
)
run_test = executable('run-js-test', 'run-js-test.c',
dependencies: [mutter_dep, mtk_dep, gdk_pixbuf_dep, gio_dep, gi_dep, gjs_dep],
dependencies: [gio_dep, gi_dep, gjs_dep, libshell_dep],
c_args: typelib_cflags,
include_directories: [conf_inc],
link_with: libshell,
build_rpath: mutter_typelibdir,
)

View File

@ -181,19 +181,22 @@ st_cflags = [
'-DPACKAGE_DATA_DIR="@0@"'.format(pkgdatadir)
]
st_deps = [
mtk_dep,
clutter_dep,
mutter_dep,
gdk_pixbuf_dep,
pango_dep,
]
# Currently meson requires a shared library for building girs
libst = shared_library('st-' + mutter_api_version,
sources: st_gir_sources + st_nogir_sources + croco_sources,
c_args: st_cflags,
dependencies: [
mtk_dep,
clutter_dep,
mutter_dep,
dependencies: st_deps + [
libxml_dep,
gdk_pixbuf_dep,
m_dep,
schemas_dep,
pango_dep,
],
build_rpath: mutter_typelibdir,
install_rpath: mutter_typelibdir,
@ -201,8 +204,11 @@ libst = shared_library('st-' + mutter_api_version,
install: true
)
libst_dep = declare_dependency(link_with: libst,
sources: st_enums[1]
libst_dep = declare_dependency(
link_with: libst,
sources: st_enums[1],
dependencies: st_deps,
include_directories: [st_inc],
)
if get_option('tests') and have_x11_client