list(APPEND EXTRALIBS ${RDMA_LIBRARIES} pthread)
endif(HAVE_RDMA)
-if(HAVE_DPDK)
- set(CMAKE_CXX_FLAGS "-march=native ${CMAKE_CXX_FLAGS} -I${DPDK_INCLUDE_DIR}")
- list(APPEND EXTRALIBS ${DPDK_LIBRARY})
- if(NOT USE_CRYPTOPP)
- message(FATAL_ERROR "CRYPTOPP must be supported when enable DPDK.")
- endif(NOT USE_CRYPTOPP)
- list(APPEND EXTRALIBS ${DPDK_LIBRARIES})
-endif(HAVE_DPDK)
-
# sort out which allocator to use
if(ALLOCATOR STREQUAL "tcmalloc")
set(ALLOC_LIBS ${GPERFTOOLS_TCMALLOC_LIBRARY})
msg/async/rdma/RDMAStack.cc)
endif(HAVE_RDMA)
-set(dpdk_common_srcs)
-if(HAVE_DPDK)
- list(APPEND dpdk_common_srcs
- msg/async/dpdk/ARP.cc
- msg/async/dpdk/DPDK.cc
- msg/async/dpdk/dpdk_rte.cc
- msg/async/dpdk/DPDKStack.cc
- msg/async/dpdk/EventDPDK.cc
- msg/async/dpdk/IP.cc
- msg/async/dpdk/net.cc
- msg/async/dpdk/IPChecksum.cc
- msg/async/dpdk/Packet.cc
- msg/async/dpdk/TCP.cc
- msg/async/dpdk/UserspaceEvent.cc
- msg/async/dpdk/ethernet.cc)
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -I${DPDK_INCLUDE_DIR}")
-endif(HAVE_DPDK)
-
add_library(common_buffer_obj OBJECT
common/buffer.cc)
msg/QueueStrategy.cc
${xio_common_srcs}
${async_rdma_common_srcs}
- ${dpdk_common_srcs}
msg/msg_types.cc
common/reverse.c
common/hobject.cc
if(HAVE_RDMA)
list(APPEND ceph_common_deps ${RDMA_LIBRARY})
endif()
-if(HAVE_DPDK)
- list(APPEND ceph_common_deps ${DPDK_LIBRARIES})
-endif()
if(NOT WITH_SYSTEM_BOOST)
list(APPEND ceph_common_deps ${ZLIB_LIBRARIES})
endif()
list(APPEND ceph_common_deps common_crc_aarch64)
endif(HAVE_ARMV8_CRC)
+if(WITH_DPDK)
+ list(APPEND common_async_dpdk_files
+ msg/async/dpdk/ARP.cc
+ msg/async/dpdk/DPDK.cc
+ msg/async/dpdk/dpdk_rte.cc
+ msg/async/dpdk/DPDKStack.cc
+ msg/async/dpdk/EventDPDK.cc
+ msg/async/dpdk/IP.cc
+ msg/async/dpdk/net.cc
+ msg/async/dpdk/IPChecksum.cc
+ msg/async/dpdk/Packet.cc
+ msg/async/dpdk/TCP.cc
+ msg/async/dpdk/UserspaceEvent.cc
+ msg/async/dpdk/ethernet.cc)
+ add_library(common_async_dpdk STATIC
+ ${common_async_dpdk_files})
+ # to ready the dpdk header files
+ add_dependencies(common_async_dpdk
+ ${DPDK_LIBRARIES})
+ list(APPEND ceph_common_deps common_async_dpdk)
+ target_link_libraries(common_async_dpdk
+ ${DPDK_LIBRARIES})
+ set_target_properties(common_async_dpdk PROPERTIES
+ COMPILE_FLAGS "-march=native -I${DPDK_INCLUDE_DIR}")
+endif(WITH_DPDK)
+
add_library(common STATIC ${ceph_common_objs})
target_link_libraries(common ${ceph_common_deps})