From da39ee0e68b6d9293133a7c41c6cf73354dce337 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Wed, 21 Feb 2024 13:57:56 -0800 Subject: [PATCH] libfdt: rework shared/static libraries Instead of creating 2 libraries manualy, just call both_libraries and link to the appropriate one as requested. Fixes compilation when passing -Ddefault_libraries=both as the static_library name is duplicated. Signed-off-by: Rosen Penev Signed-off-by: David Gibson --- libfdt/meson.build | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/libfdt/meson.build b/libfdt/meson.build index 9d07c5f..bf8343f 100644 --- a/libfdt/meson.build +++ b/libfdt/meson.build @@ -26,7 +26,7 @@ else endif link_args += version_script -libfdt = library( +libfdt = both_libraries( 'fdt', sources, version: meson.project_version(), link_args: link_args, @@ -34,17 +34,10 @@ libfdt = library( install: true, ) -link_with = libfdt - -if get_option('default_library') != 'static' - libfdt_a = static_library( - 'fdt', sources, - install: true, - ) - - if static_build - link_with = libfdt_a - endif +if static_build + link_with = libfdt.get_static_lib() +else + link_with = libfdt.get_shared_lib() endif libfdt_inc = include_directories('.')