From: Guillaume Solignac Date: Wed, 19 Jun 2024 11:32:47 +0000 (+0200) Subject: vppinfra: cleaner way of getting libdl in CMake X-Git-Tag: v25.02-rc0~67 X-Git-Url: https://gerrit.fd.io/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F60%2F41160%2F3;p=vpp.git 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 Change-Id: I9969c6be029f6a6e09cccaecd50e9eaf7d785b34 --- diff --git a/src/vppinfra/CMakeLists.txt b/src/vppinfra/CMakeLists.txt index 233e75d6e2a..0b8b6ae1226 100644 --- a/src/vppinfra/CMakeLists.txt +++ b/src/vppinfra/CMakeLists.txt @@ -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