From e5d667bf78a15ec8e51c74222cf5d23652948d6b Mon Sep 17 00:00:00 2001 From: Joseph Mingrone Date: Thu, 10 May 2018 16:36:00 -0300 Subject: [PATCH] On FreeBSD, do not link libdl The same functionality in GNU/Linux libdl is in libc on FreeBSD. See https://www.freebsd.org/cgi/man.cgi?query=dlopen --- CMakeLists.txt | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 202aaf2f8..8c4ce752b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -190,14 +190,22 @@ endif(NOT ${OPENMP_FOUND}) #------------------------------------------------------------------------------- set(INSTALL_PREFIX /usr/local CACHE PATH "Installation prefix") set(CMAKE_INSTALL_PREFIX ${INSTALL_PREFIX} CACHE INTERNAL "Installation prefix" FORCE) -set(DEFAULT_LIBRARIES dl pthread) +if(CMAKE_SYSTEM_NAME MATCHES "FreeBSD") + set(DEFAULT_LIBRARIES pthread) +else(CMAKE_SYSTEM_NAME MATCHES "FreeBSD") + set(DEFAULT_LIBRARIES dl pthread) +endif(CMAKE_SYSTEM_NAME MATCHES "FreeBSD") #------------------------------------------------------------------------------- # LIBCurl support #------------------------------------------------------------------------------- find_package(CURL) if(${CURL_FOUND} AND NOT APPLE) - set(DEFAULT_LIBRARIES dl pthread crypto curl ssl) + if(CMAKE_SYSTEM_NAME MATCHES "FreeBSD") + set(DEFAULT_LIBRARIES pthread crypto curl ssl) + else(CMAKE_SYSTEM_NAME MATCHES "FreeBSD") + set(DEFAULT_LIBRARIES dl pthread crypto curl ssl) + endif(CMAKE_SYSTEM_NAME MATCHES "FreeBSD") add_definitions (-D__HYPHYCURL__) endif(${CURL_FOUND} AND NOT APPLE)