From 56466a446ac7dd1d175275dfa13eff8abe9b6967 Mon Sep 17 00:00:00 2001 From: Vitor Santos Costa Date: Thu, 18 Aug 2016 08:11:36 +0100 Subject: [PATCH] m & pthread? --- cmake/Config.cmake | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/cmake/Config.cmake b/cmake/Config.cmake index 7a4a9f839..d89c33f9a 100644 --- a/cmake/Config.cmake +++ b/cmake/Config.cmake @@ -128,9 +128,10 @@ if (HAVE_LIBANDROID) set(EXTRALIBS ${EXTRALIBS} android) endif (HAVE_LIBANDROID) -check_library_exists(m main "" HAVE_LIBM) +find_library(HAVE_LIBM m) if (HAVE_LIBM) - set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} m) + target_link_libraries(libYap m) + set(EXTRALIBS ${EXTRALIBS} m) endif (HAVE_LIBM) check_library_exists(dl dlopen "" HAVE_LIBDL) @@ -207,10 +208,11 @@ endif (HAVE_LIBLOG) # endif (HAVE_LIBSOCKET) -check_library_exists(upthread main "" HAVE_LIBPTHREAD) +find_library(HAVE_LIBPTHREAD pthread) if (HAVE_LIBPTHREAD) - set( EXTRALIBS ${EXTRALIBS} pthread) -endif (HAVE_LIBPTHREAD) + target_link_libraries(libYap pthread) + set(EXTRALIBS ${EXTRALIBS} pthread) + endif (HAVE_LIBPTHREAD) check_library_exists(unicode main "" HAVE_LIBUNICODE)