mirror of
https://github.com/ceph/ceph
synced 2024-12-28 06:23:08 +00:00
Merge pull request #44572 from 5cs/fix-spdk-cmake
cmake/modules/BuildSPDK.cmake: link whole-archive Reviewed-by: Kefu Chai <tchaikov@gmail.com>
This commit is contained in:
commit
0f448714c2
@ -68,12 +68,14 @@ macro(build_spdk)
|
||||
add_dependencies(${spdk_lib} spdk-ext)
|
||||
endforeach()
|
||||
|
||||
set_target_properties(spdk::env_dpdk PROPERTIES
|
||||
INTERFACE_LINK_LIBRARIES "dpdk::dpdk;rt")
|
||||
set_target_properties(spdk::lvol PROPERTIES
|
||||
INTERFACE_LINK_LIBRARIES spdk::util)
|
||||
set_target_properties(spdk::util PROPERTIES
|
||||
INTERFACE_LINK_LIBRARIES ${UUID_LIBRARIES})
|
||||
set(SPDK_INCLUDE_DIR "${source_dir}/include")
|
||||
add_library(spdk::spdk INTERFACE IMPORTED)
|
||||
add_dependencies(spdk::spdk
|
||||
${SPDK_LIBRARIES})
|
||||
# workaround for https://review.spdk.io/gerrit/c/spdk/spdk/+/6798
|
||||
set_target_properties(spdk::spdk PROPERTIES
|
||||
INTERFACE_INCLUDE_DIRECTORIES ${SPDK_INCLUDE_DIR}
|
||||
INTERFACE_LINK_LIBRARIES
|
||||
"-Wl,--whole-archive $<JOIN:${spdk_libs}, > -Wl,--no-whole-archive;dpdk::dpdk;rt;${UUID_LIBRARIES}")
|
||||
unset(source_dir)
|
||||
endmacro()
|
||||
|
@ -35,7 +35,8 @@ if(HAVE_LIBAIO)
|
||||
endif(HAVE_LIBAIO)
|
||||
|
||||
if(WITH_SPDK)
|
||||
target_link_libraries(blk PRIVATE ${SPDK_LIBRARIES})
|
||||
target_link_libraries(blk
|
||||
PRIVATE spdk::spdk)
|
||||
endif()
|
||||
|
||||
if(WITH_ZBD)
|
||||
|
Loading…
Reference in New Issue
Block a user