libfdt: fix duplicate meson target

If default_library is set to static, the libfdt target (which just
uses library()) is already static, so we should just use that.

This fixes this Meson error:

	libfdt/meson.build:37:11: ERROR: Tried to create target "fdt", but a target of that name already exists.

Signed-off-by: Alyssa Ross <hi@alyssa.is>
Message-ID: <20240123130742.185409-1-hi@alyssa.is>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
Alyssa Ross 2024-01-23 14:07:42 +01:00 committed by David Gibson
parent dcef5f834e
commit 3fbfdd08af

View file

@ -34,18 +34,20 @@ libfdt = library(
install: true, install: true,
) )
link_with = libfdt
if get_option('default_library') != 'static'
libfdt_a = static_library( libfdt_a = static_library(
'fdt', sources, 'fdt', sources,
install: true, install: true,
) )
libfdt_inc = include_directories('.')
if static_build if static_build
link_with = libfdt_a link_with = libfdt_a
else
link_with = libfdt
endif endif
endif
libfdt_inc = include_directories('.')
libfdt_dep = declare_dependency( libfdt_dep = declare_dependency(
include_directories: libfdt_inc, include_directories: libfdt_inc,