diff --git a/GraphBLAS/CMakeLists.txt b/GraphBLAS/CMakeLists.txt index 8677da436b..68811a4082 100644 --- a/GraphBLAS/CMakeLists.txt +++ b/GraphBLAS/CMakeLists.txt @@ -409,7 +409,9 @@ if ( NOT NO_LIBM ) endif ( ) # libdl -if ( NOT WIN32 ) +include ( CheckLibraryExists ) +check_library_exists ( "dl" "dlopen" "${CMAKE_LIBRARY_PATH}" HAVE_DL ) +if ( HAVE_DL AND NOT WIN32 ) if ( BUILD_SHARED_LIBS ) target_link_libraries ( GraphBLAS PRIVATE dl ) endif ( )