Replace pthread and dl linking with cmake-based variables

Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
(cherry picked from commit a6a56789c9)
r14.1.x
Michele Calgaro 1 year ago
parent 9e8c893bca
commit c2a083fde3
Signed by: MicheleC
GPG Key ID: 2A75B7CA8ADED5CF

@ -27,6 +27,7 @@ set( PACKAGE_VERSION 0.7.0 )
##### include essential cmake modules ###########
include( FindPkgConfig )
include( FindThreads )
include( CheckIncludeFile )
include( CheckFunctionExists )
include( CheckLibraryExists )
@ -106,17 +107,6 @@ if( WITH_GTK )
endif( )
endif( WITH_GTK )
set( DL_LIBRARIES dl )
check_library_exists( ${DL_LIBRARIES} dlopen /lib HAVE_LIBDL )
if( NOT HAVE_LIBDL )
unset( DL_LIBRARIES )
check_function_exists( dlopen HAVE_DLOPEN )
if( HAVE_DLOPEN )
set( HAVE_LIBDL 1 )
endif( HAVE_DLOPEN )
endif( NOT HAVE_LIBDL )
set( EXTRA_LIBRARIES "-lm -lpthread" )
if( UNIX )
set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden" )
endif( UNIX )

@ -45,7 +45,7 @@ tde_add_library(
${target} SHARED
VERSION 1.0.0
SOURCES ${${target}_SRCS}
LINK ${BACKEND_LIBRARIES} ${ZLIB_LIBRARIES} ${DL_LIBRARIES} ${EXTRA_LIBRARIES}
LINK ${BACKEND_LIBRARIES} ${ZLIB_LIBRARIES} ${CMAKE_DL_LIBS} m ${CMAKE_THREAD_LIBS_INIT}
DESTINATION ${LIB_INSTALL_DIR}
)
@ -53,7 +53,7 @@ tde_add_library(
${target} STATIC_PIC
VERSION 1.0.0
SOURCES ${${target}_SRCS}
LINK ${BACKEND_LIBRARIES} ${ZLIB_LIBRARIES} ${EXTRA_LIBRARIES}
LINK ${BACKEND_LIBRARIES} ${ZLIB_LIBRARIES} m ${CMAKE_THREAD_LIBS_INIT}
DESTINATION ${LIB_INSTALL_DIR}
)

Loading…
Cancel
Save