vppinfra: cleaner way of getting libdl in CMake

Cmake has a dedicated CMAKE_DL_LIBS variable to get libdl; use it
instead of trying to find it manually.

Type: improvement
Signed-off-by: Guillaume Solignac <gsoligna@cisco.com>
Change-Id: I9969c6be029f6a6e09cccaecd50e9eaf7d785b34
This commit is contained in:
Guillaume Solignac
2024-06-19 13:32:47 +02:00
committed by Damjan Marion
parent df87789a2a
commit fb9dd88809

View File

@ -16,15 +16,7 @@ enable_language(ASM)
##############################################################################
# find libdl
##############################################################################
vpp_find_path(LIBDL_INCLUDE_DIR dlfcn.h)
vpp_find_library(LIBDL_LIB NAMES dl)
if (LIBDL_INCLUDE_DIR AND LIBDL_LIB)
message(STATUS "libdl found at ${LIBDL_LIB}")
list(APPEND VPPINFRA_LIBS ${LIBDL_LIB})
else()
message(FATAL_ERROR "libdl not found")
endif()
list(APPEND VPPINFRA_LIBS ${CMAKE_DL_LIBS})
##############################################################################
# find libunwind