diff options
author | Benoît Ganne <bganne@cisco.com> | 2020-05-05 12:25:13 +0200 |
---|---|---|
committer | Damjan Marion <dmarion@me.com> | 2020-05-06 10:23:15 +0000 |
commit | 971c5be27996985e40f178c8d540a5807a428283 (patch) | |
tree | 0d63e6329df21f528d57b8ec4e73735074da3eea /src/plugins | |
parent | 36686f47173cb97cf574a2379190e4a8e34abed5 (diff) |
rdma: fix clang build
Type: fix
Change-Id: I9b613f0af484f601dd20a851e2f59ee5e06b5c37
Signed-off-by: Benoît Ganne <bganne@cisco.com>
Diffstat (limited to 'src/plugins')
-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") |