From 88e3e70df589ee9fd4c5275bcbcc08ab8ac465c1 Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Wed, 10 Nov 2021 19:10:27 +0100 Subject: [PATCH] Use CMake's knowledge of what system library has dlopen() Signed-off-by: Gilles Peskine --- programs/test/CMakeLists.txt | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/programs/test/CMakeLists.txt b/programs/test/CMakeLists.txt index 1a79e974e..c3e7d2e98 100644 --- a/programs/test/CMakeLists.txt +++ b/programs/test/CMakeLists.txt @@ -31,9 +31,7 @@ if(USE_SHARED_MBEDTLS_LIBRARY AND NOT ${CMAKE_SYSTEM_NAME} MATCHES "[Ww][Ii][Nn]") add_executable(dlopen "dlopen.c") target_include_directories(dlopen PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../../include) - if(${CMAKE_SYSTEM_NAME} MATCHES "Linux") - target_link_libraries(dlopen "-ldl") - endif() + target_link_libraries(dlopen ${CMAKE_DL_LIBS}) endif() if(GEN_FILES)