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

* Re: [PATCH] libfdt: fix duplicate meson target
  2024-01-23 13:07 [PATCH] libfdt: fix duplicate meson target Alyssa Ross
@ 2024-01-25  2:31 ` David Gibson
  0 siblings, 0 replies; 2+ messages in thread
From: David Gibson @ 2024-01-25  2:31 UTC (permalink / raw)
  To: Alyssa Ross; +Cc: devicetree-compiler

[-- Attachment #1: Type: text/plain, Size: 1584 bytes --]

On Tue, Jan 23, 2024 at 02:07:42PM +0100, Alyssa Ross wrote:
> 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>

Applied, thanks.

> ---
>  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

-- 
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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[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).