From: Eli Schwartz Date: Thu, 14 Apr 2022 14:28:29 +0000 (-0400) Subject: meson: fix static builds creating conflicting targets X-Git-Tag: v2.39-rc1~707^2~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1c68d580d4969acd496916d8f41540e6d4dd0f81;p=thirdparty%2Futil-linux.git meson: fix static builds creating conflicting targets Meson has a global option -Ddefault_library which determines whether to build all generic libraries as static, shared, or both. When creating a library of the same name twice, once with library() and once with either shared_library() or static_library(), some values for -Ddefault_library will result in a fatal configuration error because multiple rules try to create libXXX.a or libXXX.so The reason for creating these additional copies of the library is in order to optionally build some programs as both "prog" and "prog.static" (and the latter is, of course, static). So depending on the default_library value may not be desirable. --- diff --git a/libfdisk/meson.build b/libfdisk/meson.build index 22cf663738..26c6f95fcc 100644 --- a/libfdisk/meson.build +++ b/libfdisk/meson.build @@ -57,7 +57,7 @@ lib__fdisk = static_library( dependencies : build_libfdisk ? [] : disabler()) lib_fdisk_static = static_library( - 'fdisk', + 'fdisk_static', link_whole : lib__fdisk, link_with : [lib_common, lib_blkid.get_static_lib(), diff --git a/libmount/meson.build b/libmount/meson.build index f5e2c34484..346d8054a6 100644 --- a/libmount/meson.build +++ b/libmount/meson.build @@ -65,7 +65,7 @@ lib__mount = static_library( dir_libblkid]) lib_mount_static = static_library( - 'mount', + 'mount_static', link_whole : lib__mount, link_with : [lib_common, lib_blkid.get_static_lib()],