Skip to content

Commit

Permalink
GraphBLAS: Use library as provided by CMake for dlopen and Co
Browse files Browse the repository at this point in the history
Most UNIX-like systems provide `dlopen` and similar functions in a
library named libdl.

On some platforms (like NetBSD), these functions are not in a library.
They can be used in any dynamically linked program instead:
https://man.netbsd.org/dlopen.3

Other platforms (e.g., IBM AIX) provide these functions in a differently
named library (e.g., libld).

Use the name of the library containing `dlopen` and similar functions as
provided by CMake.
  • Loading branch information
mmuetzel committed Jun 13, 2024
1 parent 360713d commit f39f756
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions GraphBLAS/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -409,13 +409,13 @@ if ( NOT NO_LIBM )
endif ( )

# libdl
if ( NOT WIN32 )
if ( NOT "${CMAKE_DL_LIBS}" STREQUAL "" )
if ( BUILD_SHARED_LIBS )
target_link_libraries ( GraphBLAS PRIVATE dl )
target_link_libraries ( GraphBLAS PRIVATE ${CMAKE_DL_LIBS} )
endif ( )
if ( BUILD_STATIC_LIBS )
list ( APPEND GRAPHBLAS_STATIC_LIBS "dl" )
target_link_libraries ( GraphBLAS_static PUBLIC dl )
list ( APPEND GRAPHBLAS_STATIC_LIBS ${CMAKE_DL_LIBS} )
target_link_libraries ( GraphBLAS_static PUBLIC ${CMAKE_DL_LIBS} )
endif ( )
endif ( )

Expand Down

0 comments on commit f39f756

Please sign in to comment.