Skip to content

Commit

Permalink
build: enable shared library build
Browse files Browse the repository at this point in the history
Enable shared library build.

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Change-Id: I40d8c814548efa5f6f7624ce602c8fa425ead2f6
Reviewed-on: https://sj1git1.cavium.com/c/IP/SW/dataplane/dpu-offload/+/144889
Tested-by: sa_ip-toolkits-Jenkins <sa_ip-toolkits-jenkins@marvell.com>
Reviewed-by: Ashwin Sekhar T K <asekhar@marvell.com>
Reviewed-by: Jerin Jacob <jerinj@marvell.com>
  • Loading branch information
anoobj authored and jerinjacobk committed Feb 10, 2025
1 parent 925fd24 commit 341e6bc
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
3 changes: 3 additions & 0 deletions config/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ major_version = version_list[0]
minor_version = version_list[1]
point_version = version_list[2]

# Set library version before updating DAO_VERSION
DAO_BUILD_CONF.set('DAO_LIB_VERSION', DAO_VERSION)

# Append DPDK version
if DAO_BUILD_CONF.has('DAO_LIBDPDK_DEP')
DAO_VERSION += '-' + dpdk_version
Expand Down
16 changes: 16 additions & 0 deletions lib/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ foreach l:libraries
libname = 'dao_' + name
includes += include_directories(l)
includes += DAO_INCLUDES

shared_deps = []
static_deps = []
foreach d:deps
if not is_variable('static_dao_' + d)
Expand All @@ -50,6 +52,7 @@ foreach l:libraries
message('Disabling @1@ [@2@]: missing internal dependency "@0@"'
.format(d, name, 'lib/' + l))
else
shared_deps += [get_variable('shared_dao_' + d)]
static_deps += [get_variable('static_dao_' + d)]
endif
endforeach
Expand All @@ -74,6 +77,19 @@ foreach l:libraries
include_directories: includes,
dependencies: static_deps)

shared_lib = shared_library(libname,
sources,
c_args: cflags,
dependencies: shared_deps + DAO_DPDK_LIB_DEPS,
include_directories: includes,
version: DAO_BUILD_CONF.get('DAO_LIB_VERSION'),
soversion: DAO_BUILD_CONF.get('DAO_VERSION_MAJOR'),
install: true)
shared_dep = declare_dependency(link_with: shared_lib,
include_directories: includes,
dependencies: shared_deps)

set_variable('shared_dao_' + name, shared_dep)
set_variable('static_dao_' + name, static_dep)

DAO_STATIC_LIBS += static_lib
Expand Down

0 comments on commit 341e6bc

Please sign in to comment.