Skip to content

Commit

Permalink
cmake: Fix DPDK libarchive dep
Browse files Browse the repository at this point in the history
If libarchive-dev is installed during build time, DPDK will depend on it
without a way to turn this off.

Accordingly the only way to address this issue is to ensure that
libarchive is added to the dependencies using similar logic as dpdk
uses.

Signed-off-by: Povilas Kanapickas <[email protected]>
  • Loading branch information
p12tic authored and avikivity committed Oct 16, 2024
1 parent ef545f0 commit d6dd763
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions cmake/Finddpdk.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,13 @@ if ("bsd" IN_LIST dpdk_PC_LIBRARIES)
list (APPEND dpdk_dependencies "bsd")
endif ()

# As of DPDK 23.07, if libarchive-dev is present, it will make DPDK depend on the library.
# Unfortunately DPDK also has a bug in its .pc file generation and will not include libarchive
# dependency under any circumstance. Accordingly, the dependency is added explicitly if libarchive
# exists.
pkg_check_modules(libarchive_PC libarchive)
list(APPEND dpdk_dependencies ${libarchive_PC_LIBRARIES})

if (dpdk_FOUND AND NOT (TARGET dpdk))
get_filename_component (library_suffix "${dpdk_EAL_LIBRARY}" LAST_EXT)
# strictly speaking, we should have being using check_c_compiler_flag()
Expand Down

0 comments on commit d6dd763

Please sign in to comment.