summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorBenoît Ganne <bganne@cisco.com>2020-05-05 12:25:13 +0200
committerAndrew Yourtchenko <ayourtch@gmail.com>2020-08-18 09:54:56 +0000
commit6e25cf65050f98fe5f0c9f6d91a5d3375b0cd608 (patch)
tree7dc63d252a9fedb1e10e0b68da0e495aca077de8 /src/plugins
parent84c13e6b0246ca037183d3f8f3916777bc22ed56 (diff)
rdma: fix clang build
Type: fix Change-Id: I9b613f0af484f601dd20a851e2f59ee5e06b5c37 Signed-off-by: Benoît Ganne <bganne@cisco.com> (cherry picked from commit 971c5be27996985e40f178c8d540a5807a428283)
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/rdma/CMakeLists.txt11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/plugins/rdma/CMakeLists.txt b/src/plugins/rdma/CMakeLists.txt
index bf111195ecc..b04c5c12d18 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")