Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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]>
neheb committed Feb 21, 2024
1 parent a669223 commit 35d7d17
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
@@ -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('.')

0 comments on commit 35d7d17

Please sign in to comment.