diff options
-rw-r--r-- | ConfigureChecks.cmake | 8 | ||||
-rw-r--r-- | src/CMakeLists.txt | 2 |
2 files changed, 10 insertions, 0 deletions
diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake index d68578f..6dfac8a 100644 --- a/ConfigureChecks.cmake +++ b/ConfigureChecks.cmake @@ -132,7 +132,15 @@ int main(void) { return 0; }" HAVE_SOCKADDR_STORAGE) +check_library_exists(dl dlopen "" HAVE_LIBDL) +if (HAVE_LIBDL) + find_library(DLFCN_LIBRARY dl) + set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${DLFCN_LIBRARY}) +endif (HAVE_LIBDL) + # ENDIAN if (NOT WIN32) test_big_endian(WORDS_BIGENDIAN) endif (NOT WIN32) + +set(SWRAP_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} CACHE INTERNAL "swrap required system libraries") diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 23fdf60..96b6cd1 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -3,6 +3,8 @@ project(libsocket_wrapper C) include_directories(${CMAKE_BINARY_DIR}) add_library(socket_wrapper SHARED socket_wrapper.c) +target_link_libraries(socket_wrapper ${SWRAP_REQUIRED_LIBRARIES}) + install( TARGETS socket_wrapper |