Skip to content

Commit

Permalink
Simplify libdl handling
Browse files Browse the repository at this point in the history
CMake has builtin variable CMAKE_DL_LIBS which contains correct dynamic linker library (-ldl for linux, empty for *BSD etc.)
  • Loading branch information
AMDmi3 committed Aug 25, 2016
1 parent 3e82286 commit d040682
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions tests/CMakeLists.txt
Expand Up @@ -41,12 +41,7 @@ if(BUILD_TESTS)


find_package(Threads)
set(TARGET_LINK_LIB ${TARGET_LINK_LIB} ${CMAKE_THREAD_LIBS_INIT} ${TARGET_LINK})

if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
find_library(DL_LIB dl)
set(TARGET_LINK_LIB ${TARGET_LINK_LIB} ${DL_LIB})
endif()
set(TARGET_LINK_LIB ${TARGET_LINK_LIB} ${CMAKE_THREAD_LIBS_INIT} ${CMAKE_DL_LIBS} ${TARGET_LINK})

find_library(M_LIB m)
set(TARGET_LINK_LIB ${TARGET_LINK_LIB} ${M_LIB})
Expand Down

0 comments on commit d040682

Please sign in to comment.