From 6c47cea2b97328210a3527553efacbb417d1030c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Thu, 23 Jan 2025 05:13:25 +0100 Subject: [PATCH] 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: --- src/meson.build | 13 ++++++++----- src/st/meson.build | 22 ++++++++++++++-------- 2 files changed, 22 insertions(+), 13 deletions(-) diff --git a/src/meson.build b/src/meson.build index 923d95220..6b24535d5 100644 --- a/src/meson.build +++ b/src/meson.build @@ -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, ) diff --git a/src/st/meson.build b/src/st/meson.build index 8958b16a8..72a354cf8 100644 --- a/src/st/meson.build +++ b/src/st/meson.build @@ -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