Skip to content

Commit e90a405

Browse files
p12tictchaikov
andcommitted
build: Do not expose dependency to dpdk in installed cmake files
seastar currently includes the objects of the dpdk library to within its static library. As a result, dpdk library may as well not exist to outside users - it is effectively an implementation detail. Unfortunately it is exposed in the INTERFACE_LINK_LIBRARIES list of the installed Seastar::seastar target. This is a known problem in CMake https://gitlab.kitware.com/cmake/cmake/-/issues/15415 and the solution is to use BUILD_INTERFACE generator expression. Co-authored-by: Kefu Chai <[email protected]>
1 parent b63b02a commit e90a405

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

Diff for: CMakeLists.txt

+8-1
Original file line numberDiff line numberDiff line change
@@ -875,9 +875,16 @@ else ()
875875
endif ()
876876

877877
if (Seastar_DPDK)
878+
# Although Seastar uses DPDK internally, DPDK symbols should not be exposed to
879+
# Seastar users. However, DPDK's dependencies (like numa, pthread) must still
880+
# be included in Seastar's INTERFACE_LINK_LIBRARIES to ensure proper linking
881+
# of applications using Seastar.
878882
target_link_libraries (seastar
879883
PRIVATE
880-
DPDK::dpdk)
884+
"$<BUILD_INTERFACE:DPDK::dpdk>")
885+
get_target_property(DPDK_INTERFACE_LINK_LIBRARIES DPDK::dpdk INTERFACE_LINK_LIBRARIES)
886+
target_link_libraries (seastar
887+
PRIVATE "${DPDK_INTERFACE_LINK_LIBRARIES}")
881888
endif ()
882889

883890
include (TriStateOption)

0 commit comments

Comments
 (0)