Skip to content

Commit

Permalink
libfdt: fix duplicate meson target
Browse files Browse the repository at this point in the history
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 <[email protected]>
Message-ID: <[email protected]>
Signed-off-by: David Gibson <[email protected]>
  • Loading branch information
alyssais authored and dgibson committed Jan 25, 2024
1 parent dcef5f8 commit 3fbfdd0
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions libfdt/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 3fbfdd0

Please sign in to comment.