devicetree-compiler.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] libfdt: fix duplicate meson target
@ 2024-01-23 13:07 Alyssa Ross
  2024-01-25  2:31 ` David Gibson
  0 siblings, 1 reply; 2+ messages in thread
From: Alyssa Ross @ 2024-01-23 13:07 UTC (permalink / raw)
  To: devicetree-compiler

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>
---
 libfdt/meson.build | 22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 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
+
+if get_option('default_library') != 'static'
+  libfdt_a = static_library(
+    'fdt', sources,
+    install: true,
+  )
+
+  if static_build
+    link_with = libfdt_a
+  endif
+endif
 
 libfdt_inc = include_directories('.')
 
-if static_build
-  link_with = libfdt_a
-else
-  link_with = libfdt
-endif
-
 libfdt_dep = declare_dependency(
   include_directories: libfdt_inc,
   link_with: link_with,

base-commit: 95c74d71f0904235d44892627322f60a18c9a28c
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-01-25  3:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-23 13:07 [PATCH] libfdt: fix duplicate meson target Alyssa Ross
2024-01-25  2:31 ` David Gibson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).