diff --git a/cmake/Finddpdk.cmake b/cmake/Finddpdk.cmake index 65f060f03f..a90e70c453 100644 --- a/cmake/Finddpdk.cmake +++ b/cmake/Finddpdk.cmake @@ -84,6 +84,14 @@ endif () list (APPEND dpdk_REQUIRED dpdk_INCLUDE_DIR) +# Depending on whether libbsd-dev exists at build time, DPDK may be built with a dependency on +# libbsd. Note that other libraries in dpdk_PC_LIBRARIES are handled using separate logic +# (see rte_libs above), thus the additional dependencies must be handled on a case by case basis. +set (dpdk_dependencies "") +if ("bsd" IN_LIST dpdk_PC_LIBRARIES) + list (APPEND dpdk_dependencies "bsd") +endif () + # we prefer static library over the shared library, so just find the # static libraries first. set (_cmake_find_library_suffixes_saved ${CMAKE_FIND_LIBRARY_SUFFIXES}) @@ -163,6 +171,7 @@ if (dpdk_FOUND AND NOT (TARGET dpdk)) set_target_properties (dpdk PROPERTIES INTERFACE_INCLUDE_DIRECTORIES ${dpdk_INCLUDE_DIR} + INTERFACE_LINK_LIBRARIES ${dpdk_dependencies} IMPORTED_OBJECTS ${dpdk_object_path} ${compile_options}) # we include dpdk in seastar already, so no need to expose it with @@ -175,7 +184,7 @@ if (dpdk_FOUND AND NOT (TARGET dpdk)) set_target_properties (DPDK::dpdk PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${dpdk_PC_INCLUDE_DIRS}" - INTERFACE_LINK_LIBRARIES "${_dpdk_libraries}" + INTERFACE_LINK_LIBRARIES "${_dpdk_libraries} ${dpdk_dependencies}" ${compile_options}) endif() endif ()