|
| 1 | +diff --git a/buildlib/rdma_functions.cmake b/buildlib/rdma_functions.cmake |
| 2 | +index ef77d95d0..84e650497 100644 |
| 3 | +--- a/buildlib/rdma_functions.cmake |
| 4 | ++++ b/buildlib/rdma_functions.cmake |
| 5 | +@@ -117,7 +117,10 @@ function(rdma_library DEST VERSION_SCRIPT SOVERSION VERSION) |
| 6 | + SOVERSION ${SOVERSION} |
| 7 | + VERSION ${VERSION} |
| 8 | + LIBRARY_OUTPUT_DIRECTORY "${BUILD_LIB}") |
| 9 | +- install(TARGETS ${DEST} DESTINATION "${CMAKE_INSTALL_LIBDIR}") |
| 10 | ++ |
| 11 | ++ if(NOT ENABLE_STATIC) |
| 12 | ++ install(TARGETS ${DEST} DESTINATION "${CMAKE_INSTALL_LIBDIR}") |
| 13 | ++ endif() |
| 14 | + endfunction() |
| 15 | + |
| 16 | + # Create a special provider with exported symbols in it The shared provider |
| 17 | +@@ -153,20 +156,23 @@ function(rdma_shared_provider DEST VERSION_SCRIPT SOVERSION VERSION) |
| 18 | + SOVERSION ${SOVERSION} |
| 19 | + VERSION ${VERSION} |
| 20 | + LIBRARY_OUTPUT_DIRECTORY "${BUILD_LIB}") |
| 21 | +- install(TARGETS ${DEST} DESTINATION "${CMAKE_INSTALL_LIBDIR}") |
| 22 | +- |
| 23 | +- # Compute a relative symlink from VERBS_PROVIDER_DIR to LIBDIR |
| 24 | +- execute_process(COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/buildlib/relpath |
| 25 | +- "${CMAKE_INSTALL_FULL_LIBDIR}/lib${DEST}.so.${VERSION}" |
| 26 | +- "${VERBS_PROVIDER_DIR}" |
| 27 | +- OUTPUT_VARIABLE DEST_LINK_PATH OUTPUT_STRIP_TRAILING_WHITESPACE |
| 28 | +- RESULT_VARIABLE retcode) |
| 29 | +- if(NOT "${retcode}" STREQUAL "0") |
| 30 | +- message(FATAL_ERROR "Unable to run buildlib/relpath, do you have python?") |
| 31 | +- endif() |
| 32 | + |
| 33 | +- rdma_install_symlink("${DEST_LINK_PATH}" "${VERBS_PROVIDER_DIR}/lib${DEST}${IBVERBS_PROVIDER_SUFFIX}") |
| 34 | +- rdma_create_symlink("lib${DEST}.so.${VERSION}" "${BUILD_LIB}/lib${DEST}${IBVERBS_PROVIDER_SUFFIX}") |
| 35 | ++ if(NOT ENABLE_STATIC) |
| 36 | ++ install(TARGETS ${DEST} DESTINATION "${CMAKE_INSTALL_LIBDIR}") |
| 37 | ++ |
| 38 | ++ # Compute a relative symlink from VERBS_PROVIDER_DIR to LIBDIR |
| 39 | ++ execute_process(COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/buildlib/relpath |
| 40 | ++ "${CMAKE_INSTALL_FULL_LIBDIR}/lib${DEST}.so.${VERSION}" |
| 41 | ++ "${VERBS_PROVIDER_DIR}" |
| 42 | ++ OUTPUT_VARIABLE DEST_LINK_PATH OUTPUT_STRIP_TRAILING_WHITESPACE |
| 43 | ++ RESULT_VARIABLE retcode) |
| 44 | ++ if(NOT "${retcode}" STREQUAL "0") |
| 45 | ++ message(FATAL_ERROR "Unable to run buildlib/relpath, do you have python?") |
| 46 | ++ endif() |
| 47 | ++ |
| 48 | ++ rdma_install_symlink("${DEST_LINK_PATH}" "${VERBS_PROVIDER_DIR}/lib${DEST}${IBVERBS_PROVIDER_SUFFIX}") |
| 49 | ++ rdma_create_symlink("lib${DEST}.so.${VERSION}" "${BUILD_LIB}/lib${DEST}${IBVERBS_PROVIDER_SUFFIX}") |
| 50 | ++ endif() |
| 51 | + endfunction() |
| 52 | + |
| 53 | + # Create a provider shared library for libibverbs |
| 54 | +@@ -201,15 +207,17 @@ function(rdma_provider DEST) |
| 55 | + # Provider Plugins do not use SONAME versioning, there is no reason to |
| 56 | + # create the usual symlinks. |
| 57 | + |
| 58 | +- if (VERBS_PROVIDER_DIR) |
| 59 | +- install(TARGETS ${DEST} DESTINATION "${VERBS_PROVIDER_DIR}") |
| 60 | +- else() |
| 61 | +- install(TARGETS ${DEST} DESTINATION "${CMAKE_INSTALL_LIBDIR}") |
| 62 | ++ if(NOT ENABLE_STATIC) |
| 63 | ++ if (VERBS_PROVIDER_DIR) |
| 64 | ++ install(TARGETS ${DEST} DESTINATION "${VERBS_PROVIDER_DIR}") |
| 65 | ++ else() |
| 66 | ++ install(TARGETS ${DEST} DESTINATION "${CMAKE_INSTALL_LIBDIR}") |
| 67 | + |
| 68 | +- # FIXME: This symlink is provided for compat with the old build, but it |
| 69 | +- # never should have existed in the first place, nothing should use this |
| 70 | +- # name, we can probably remove it. |
| 71 | +- rdma_install_symlink("lib${DEST}${IBVERBS_PROVIDER_SUFFIX}" "${CMAKE_INSTALL_LIBDIR}/lib${DEST}.so") |
| 72 | ++ # FIXME: This symlink is provided for compat with the old build, but it |
| 73 | ++ # never should have existed in the first place, nothing should use this |
| 74 | ++ # name, we can probably remove it. |
| 75 | ++ rdma_install_symlink("lib${DEST}${IBVERBS_PROVIDER_SUFFIX}" "${CMAKE_INSTALL_LIBDIR}/lib${DEST}.so") |
| 76 | ++ endif() |
| 77 | + endif() |
| 78 | + endfunction() |
| 79 | + |
0 commit comments