diff options
-rw-r--r-- | src/plugins/rdma/CMakeLists.txt | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/plugins/rdma/CMakeLists.txt b/src/plugins/rdma/CMakeLists.txt index 86fc68f550a..cc104f871c1 100644 --- a/src/plugins/rdma/CMakeLists.txt +++ b/src/plugins/rdma/CMakeLists.txt @@ -29,8 +29,15 @@ endif() string_append(RDMA_LINK_FLAGS "-Wl,--whole-archive,${MLX5_LIB},--no-whole-archive") -set(CMAKE_REQUIRED_FLAGS "-fPIC -shared -pthread ${RDMA_LINK_FLAGS} ${IBVERBS_LIB} ${RDMA_UTIL_LIB}") -CHECK_C_SOURCE_COMPILES("int main(void) { return 0; }" IBVERBS_COMPILES_CHECK) +set(CMAKE_REQUIRED_FLAGS "-fPIC -shared -pthread -Wno-unused-command-line-argument ${RDMA_LINK_FLAGS} ${IBVERBS_LIB} ${RDMA_UTIL_LIB}") +set(CMAKE_REQUIRED_INCLUDES "${IBVERBS_INCLUDE_DIR}") +set(CMAKE_REQUIRED_LIBRARIES "c") # force linkage by including libc explicitely +CHECK_C_SOURCE_COMPILES(" +#include <infiniband/verbs.h> +int main(void) +{ + return 0 != ibv_get_device_list(0); +}" IBVERBS_COMPILES_CHECK) if (NOT IBVERBS_COMPILES_CHECK) message(WARNING "rdma plugins - no working ibverbs found - rdma plugin disabled") |