From 68cf00ee09432b8d9515a4ac0eb269c26d8661df Mon Sep 17 00:00:00 2001 From: Manolo Gouy Date: Tue, 14 Jun 2016 05:19:32 +0000 Subject: THE best way to test for availability of dlsym(). git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11779 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- CMake/resources.cmake | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/CMake/resources.cmake b/CMake/resources.cmake index eb2e1a4b3..8af7ca2cd 100644 --- a/CMake/resources.cmake +++ b/CMake/resources.cmake @@ -106,14 +106,9 @@ if(HAVE_DLFCN_H) set(HAVE_DLFCN_H 1) endif(HAVE_DLFCN_H) -if(LIB_dl) - set(CMAKE_REQUIRED_LIBRARIES ${LIB_dl}) - CHECK_FUNCTION_EXISTS(dlsym HAVE_DLSYM) - set(CMAKE_REQUIRED_LIBRARIES) -else() -# test also for systems where dlsym() is not in libdl (e.g., NetBSD, FreeBSD) - CHECK_FUNCTION_EXISTS(dlsym HAVE_DLSYM) -endif(LIB_dl) +set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_DL_LIBS}) +CHECK_FUNCTION_EXISTS(dlsym HAVE_DLSYM) +set(CMAKE_REQUIRED_LIBRARIES) CHECK_FUNCTION_EXISTS(localeconv HAVE_LOCALECONV) -- cgit v1.2.3