vppinfra: cleaner way of getting libdl in CMake 60/41160/3
authorGuillaume Solignac <gsoligna@cisco.com>
Wed, 19 Jun 2024 11:32:47 +0000 (13:32 +0200)
committerDamjan Marion <dmarion@0xa5.net>
Wed, 21 Aug 2024 12:05:27 +0000 (12:05 +0000)
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

src/vppinfra/CMakeLists.txt

index 233e75d..0b8b6ae 100644 (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