From: luo rixin Date: Thu, 28 Nov 2019 12:18:09 +0000 (+0800) Subject: cmake: Add shared library as dpdk dependency X-Git-Tag: v15.1.0~714^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F31841%2Fhead;p=ceph.git cmake: Add shared library as dpdk dependency librte_eal.a refers to libpthread.so and libdl.so, and libceph-common.so refers to librte_eal.a. Many test application link libceph-common.so without linking pthread, it will cause link error. Such as unittest_interval_set, target_link_libraries (unittest_interval_set ceph-common) Signed-off-by: Chunsong Feng --- diff --git a/cmake/modules/BuildDPDK.cmake b/cmake/modules/BuildDPDK.cmake index 30f2aea0e4bc..e324d2f0a09b 100644 --- a/cmake/modules/BuildDPDK.cmake +++ b/cmake/modules/BuildDPDK.cmake @@ -176,7 +176,7 @@ function(do_export_dpdk dpdk_dir) set_target_properties(dpdk::dpdk PROPERTIES INTERFACE_INCLUDE_DIRECTORIES ${DPDK_INCLUDE_DIR} INTERFACE_LINK_LIBRARIES - "-Wl,--whole-archive $ -Wl,--no-whole-archive ${dpdk_numa}") + "-Wl,--whole-archive $ -Wl,--no-whole-archive ${dpdk_numa} -Wl,-lpthread,-ldl") if(dpdk_rte_CFLAGS) set_target_properties(dpdk::dpdk PROPERTIES INTERFACE_COMPILE_OPTIONS "${dpdk_rte_CFLAGS}")