f93a605f2d
To allow other projects to easily use DPDK as a subproject, add in the necessary dependency definitions. Slightly different definitions are necessary for static and shared builds, since for shared builds the drivers should not be linked in, and the internal meson dependency objects are more complete. To use DPDK as a subproject fallback i.e. use installed DPDK if present, otherwise the shipped one, the following meson statement can be used: libdpdk = dependency('libdpdk', fallback: ['dpdk', 'dpdk_dep']) Signed-off-by: Stephen Hemminger <stephen@networkplumber.org> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com> Reviewed-by: Ben Magistro <koncept1@gmail.com> Tested-by: Ben Magistro <koncept1@gmail.com>
22 lines
832 B
Meson
22 lines
832 B
Meson
# SPDX-License-Identifier: BSD-3-Clause
|
|
# Copyright(c) 2022 Intel Corporation
|
|
|
|
message('DPDK subproject linking: ' + get_option('default_library'))
|
|
if get_option('default_library') == 'static'
|
|
dpdk_dep = declare_dependency(
|
|
version: meson.project_version(),
|
|
dependencies: dpdk_static_lib_deps,
|
|
# static library deps in DPDK build don't include "link_with" parameters,
|
|
# so explicitly link-in both libs and drivers
|
|
link_with: dpdk_static_libraries,
|
|
link_whole: dpdk_drivers,
|
|
link_args: dpdk_extra_ldflags)
|
|
else
|
|
dpdk_dep = declare_dependency(
|
|
version: meson.project_version(),
|
|
# shared library deps include all necessary linking parameters
|
|
dependencies: dpdk_shared_lib_deps)
|
|
endif
|
|
|
|
libdpdk_dep = dpdk_dep
|