Use CMake's knowledge of what system library has dlopen()

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
This commit is contained in:
Gilles Peskine 2021-11-10 19:10:27 +01:00
parent 507c787b44
commit 99d8486f8e

View file

@ -39,9 +39,7 @@ if(USE_SHARED_MBEDTLS_LIBRARY AND
NOT ${CMAKE_SYSTEM_NAME} MATCHES "[Ww][Ii][Nn]") NOT ${CMAKE_SYSTEM_NAME} MATCHES "[Ww][Ii][Nn]")
add_executable(dlopen "dlopen.c") add_executable(dlopen "dlopen.c")
target_include_directories(dlopen PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../../include) target_include_directories(dlopen PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../../include)
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux") target_link_libraries(dlopen ${CMAKE_DL_LIBS})
target_link_libraries(dlopen "-ldl")
endif()
endif() endif()
foreach(exe IN LISTS executables_libs executables_mbedcrypto) foreach(exe IN LISTS executables_libs executables_mbedcrypto)