diff options
author | Jordan Williams <jordan@jwillikers.com> | 2024-04-05 08:33:22 -0700 |
---|---|---|
committer | Jordan Williams <jordan@jwillikers.com> | 2024-04-05 08:33:22 -0700 |
commit | c43b185a3feb8cd7261c94f42a566486ce2c0438 (patch) | |
tree | c50b108c0dbd232c8fb12e871e9762995389226a | |
parent | 6f548300b2b823af0b2ae208e12ddfdeebe3e71d (diff) | |
download | util-linux-c43b185a3feb8cd7261c94f42a566486ce2c0438.tar.gz |
meson: Use libmount as a dependency
Several utilities depend on libmount internally.
Currently, link_with and global include directories are used to
associate targets with libmount.
This PR uses Meson's dependencies argument for targets to define this
relationship instead.
This carries include directories along with the library to link.
An additional dependency is declared for the static libmount library.
A couple of executables use this dependency explicitly.
Signed-off-by: Jordan Williams <jordan@jwillikers.com>
-rw-r--r-- | libmount/meson.build | 1 | ||||
-rw-r--r-- | libmount/python/meson.build | 5 | ||||
-rw-r--r-- | meson.build | 58 |
3 files changed, 30 insertions, 34 deletions
diff --git a/libmount/meson.build b/libmount/meson.build index d1262e7f04..ea363a0d52 100644 --- a/libmount/meson.build +++ b/libmount/meson.build @@ -80,6 +80,7 @@ lib_mount_static = static_library( lib_blkid.get_static_lib()], dependencies : [realtime_libs], install : false) +mount_static_dep = declare_dependency(link_with: lib_mount_static, include_directories: '.') lib__mount_deps = [ lib_selinux, diff --git a/libmount/python/meson.build b/libmount/python/meson.build index e1a79d187d..702ca8f378 100644 --- a/libmount/python/meson.build +++ b/libmount/python/meson.build @@ -21,10 +21,9 @@ if build_python python.extension_module( 'pylibmount', pylibmount_sources, - include_directories : [dir_include, dir_libmount], + include_directories : [dir_include], subdir : 'libmount', - link_with : lib_mount, - dependencies : python.dependency(), + dependencies : [mount_dep, python.dependency()], c_args : [ '-Wno-cast-function-type', diff --git a/meson.build b/meson.build index 688ea91202..0b0dc27c12 100644 --- a/meson.build +++ b/meson.build @@ -975,7 +975,6 @@ subdir('po') includes = [dir_include, dir_libblkid, dir_libsmartcols, - dir_libmount, dir_libfdisk, dir_libuuid, dir_liblastlog2, @@ -1503,8 +1502,8 @@ exe = executable( 'fstrim', fstrim_sources, include_directories : includes, - link_with : [lib_common, - lib_mount], + link_with : [lib_common], + dependencies : [mount_dep], install_dir : sbindir, install : true) if not is_disabler(exe) @@ -1654,8 +1653,8 @@ exe = executable( 'eject', eject_sources, include_directories : includes, - link_with : [lib_common, - lib_mount], + link_with : [lib_common], + dependencies : [mount_dep], install_dir : usrbin_exec_dir, install : opt, build_by_default : opt) @@ -1731,8 +1730,8 @@ exe = executable( lsns_sources, include_directories : includes, link_with : [lib_common, - lib_smartcols, - lib_mount], + lib_smartcols], + dependencies : [mount_dep], install_dir : usrbin_exec_dir, install : true) if not is_disabler(exe) @@ -1747,9 +1746,8 @@ exe = executable( mount_sources, include_directories : includes, link_with : [lib_common, - lib_smartcols, - lib_mount], - dependencies : lib_selinux, + lib_smartcols], + dependencies : [lib_selinux, mount_dep], install_mode : 'rwsr-xr-x', install : opt, build_by_default : opt) @@ -1757,8 +1755,8 @@ exe2 = executable( 'umount', umount_sources, include_directories : includes, - link_with : [lib_common, - lib_mount], + link_with : [lib_common], + dependencies : [mount_dep], install_mode : 'rwsr-xr-x', install : opt, build_by_default : opt) @@ -1777,8 +1775,8 @@ exe = executable( include_directories : includes, link_args : ['--static'], link_with : [lib_common, - lib_smartcols_static, - lib_mount_static], + lib_smartcols_static], + dependencies : [mount_static_dep], install : opt2, build_by_default : opt2) if opt2 and not is_disabler(exe) @@ -1791,8 +1789,8 @@ exe = executable( umount_sources, include_directories : includes, link_args : ['--static'], - link_with : [lib_common, - lib_mount_static], + link_with : [lib_common], + dependencies : [mount_static_dep], install : opt2, build_by_default : opt2) if opt2 and not is_disabler(exe) @@ -1807,8 +1805,8 @@ exe = executable( include_directories : includes, link_with : [lib_common, lib_blkid, - lib_mount, lib_smartcols], + dependencies : [mount_dep], install_dir : sbindir, install : true) if not is_disabler(exe) @@ -1822,8 +1820,8 @@ exe = executable( swapoff_sources, include_directories : includes, link_with : [lib_common, - lib_blkid, - lib_mount], + lib_blkid], + dependencies : [mount_dep], install_dir : sbindir, install : true) if not is_disabler(exe) @@ -1876,7 +1874,7 @@ exe = executable( 'mountpoint', mountpoint_sources, include_directories : includes, - link_with : [lib_mount], + dependencies : [mount_dep], install : opt, build_by_default : opt) if opt and not is_disabler(exe) @@ -1936,6 +1934,7 @@ exe = executable( unshare_sources, include_directories : includes, link_with : [lib_common], + dependencies : [mount_dep], install_dir : usrbin_exec_dir, install : opt, build_by_default : opt) @@ -1951,6 +1950,7 @@ exe = executable( unshare_sources, include_directories : includes, link_with : [lib_common], + dependencies : [mount_dep], install_dir : usrbin_exec_dir, install : opt, build_by_default : opt) @@ -2156,9 +2156,8 @@ exe = executable( fsck_sources, include_directories : includes, link_with : [lib_common, - lib_blkid, - lib_mount], - dependencies : realtime_libs, + lib_blkid], + dependencies : [realtime_libs, mount_dep], install_dir : sbindir, install : opt, build_by_default : opt) @@ -2345,9 +2344,8 @@ exe = executable( link_with : [lib_common, lib_fdisk, lib_smartcols, - lib_tcolors, - lib_mount], - dependencies : [curses_libs], + lib_tcolors], + dependencies : [curses_libs, mount_dep], install_dir : sbindir, install : opt, build_by_default : opt) @@ -2731,8 +2729,8 @@ exe = executable( lslocks_sources, include_directories : includes, link_with : [lib_common, - lib_mount, lib_smartcols], + dependencies : [mount_dep], install_dir : usrbin_exec_dir, install : true) if not is_disabler(exe) @@ -2747,10 +2745,9 @@ exe = executable( include_directories : includes, link_with : [lib_common, lib_blkid, - lib_mount, lib_tcolors, lib_smartcols], - dependencies : lib_udev, + dependencies : [lib_udev, mount_dep], install : true) if not is_disabler(exe) exes += exe @@ -2947,9 +2944,8 @@ exe = executable( include_directories : includes, link_with : [lib_common, lib_blkid, - lib_mount, lib_smartcols], - dependencies : [lib_udev], + dependencies : [lib_udev, mount_dep], install : true) if not is_disabler(exe) exes += exe |