diff mbox series

[rdma-core,4/9] pkg-config: If static libraries are enabled add Requires.private

Message ID 20181023205701.3729-5-jgg@ziepe.ca (mailing list archive)
State Not Applicable
Headers show
Series Build static libraries in rdma-core | expand

Commit Message

Jason Gunthorpe Oct. 23, 2018, 8:56 p.m. UTC
From: Jason Gunthorpe <jgg@mellanox.com>

We don't want to add Requires.private when not producing static libraries
as that causes pkg-config to require the devel packages to be installed to
get the private .pc files even though it doesn't need any of the
information.

Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
---
 libibverbs/CMakeLists.txt | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/libibverbs/CMakeLists.txt b/libibverbs/CMakeLists.txt
index 33e86a409708b0..3e60c808636847 100644
--- a/libibverbs/CMakeLists.txt
+++ b/libibverbs/CMakeLists.txt
@@ -54,4 +54,11 @@  target_link_libraries(ibverbs LINK_PRIVATE
   kern-abi
   )
 
-rdma_pkg_config("ibverbs" "" "${CMAKE_THREAD_LIBS_INIT}")
+if (ENABLE_STATIC)
+  if (NOT NL_KIND EQUAL 0)
+    set(REQUIRES "libnl-3.0, libnl-route-3.0")
+  endif()
+  rdma_pkg_config("ibverbs" "${REQUIRES}" "${CMAKE_THREAD_LIBS_INIT}")
+else()
+  rdma_pkg_config("ibverbs" "" "${CMAKE_THREAD_LIBS_INIT}")
+endif()