aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2024-01-23 14:07:42 +0100
committerDavid Gibson <david@gibson.dropbear.id.au>2024-01-25 13:24:40 +1100
commit3fbfdd08afd2a7a25b27433f6f5678c0fe694721 (patch)
tree93d5be663d32da7fd1a3e8d56bdbeddc3ae5aaf7
parentdcef5f834ea34bcb9f8d0e86db1268fde52ead77 (diff)
downloaddtc-3fbfdd08afd2a7a25b27433f6f5678c0fe694721.tar.gz
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>
-rw-r--r--libfdt/meson.build20
1 files changed, 11 insertions, 9 deletions
diff --git a/libfdt/meson.build b/libfdt/meson.build
index 2ea1448..9d07c5f 100644
--- a/libfdt/meson.build
+++ b/libfdt/meson.build
@@ -34,19 +34,21 @@ libfdt = library(
install: true,
)
-libfdt_a = static_library(
- 'fdt', sources,
- install: true,
-)
+link_with = libfdt
-libfdt_inc = include_directories('.')
+if get_option('default_library') != 'static'
+ libfdt_a = static_library(
+ 'fdt', sources,
+ install: true,
+ )
-if static_build
- link_with = libfdt_a
-else
- link_with = libfdt
+ if static_build
+ link_with = libfdt_a
+ endif
endif
+libfdt_inc = include_directories('.')
+
libfdt_dep = declare_dependency(
include_directories: libfdt_inc,
link_with: link_with,