Skip to contentSkip to conversation

libfdt: fix duplicate meson target

PATCH Applied Alyssa Ross 2 participants 2 messages Jan 23, 2024 – Jan 25, 2024 Arm/Amlogic Meson SoC support

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 libfdt/meson.build | 22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)
libfdt/meson.build +12 -10
index 2ea1448..9d07c5f 100644
@@ -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

Signature · 1 line
2.43.0
Applied
#1 lore raw
Quoted 8 lines · Alyssa Ross

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.

Applied, thanks.

Quoted 42 lines
---
 libfdt/meson.build | 22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)
libfdt/meson.build +12 -10
index 2ea1448..9d07c5f 100644
@@ -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

Signature · 4 lines
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson