Skip to content

Commit

Permalink
libfdt: rework shared/static libraries
Browse files Browse the repository at this point in the history
Instead of creating 2 libraries manualy, just call both_libraries and
link to the appropriate one as requested.

Fixes compilation when passing -Ddefault_libraries=both as the
static_library name is duplicated.

Signed-off-by: Rosen Penev <[email protected]>
Signed-off-by: David Gibson <[email protected]>
  • Loading branch information
neheb authored and dgibson committed Feb 22, 2024
1 parent a669223 commit da39ee0
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions libfdt/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -26,25 +26,18 @@ else
endif

link_args += version_script
libfdt = library(
libfdt = both_libraries(
'fdt', sources,
version: meson.project_version(),
link_args: link_args,
link_depends: 'version.lds',
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
if static_build
link_with = libfdt.get_static_lib()
else
link_with = libfdt.get_shared_lib()
endif

libfdt_inc = include_directories('.')
Expand Down

0 comments on commit da39ee0

Please sign in to comment.