From 0c67af00acba39ea5584fad034e0beda047d73fd Mon Sep 17 00:00:00 2001 From: Federico Di Pierro Date: Thu, 29 Aug 2024 14:03:51 +0200 Subject: [PATCH] chore(userspace/libsinsp): only link libanl if present. Signed-off-by: Federico Di Pierro --- userspace/libsinsp/CMakeLists.txt | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/userspace/libsinsp/CMakeLists.txt b/userspace/libsinsp/CMakeLists.txt index f701a539a3..1ffa22bbbc 100644 --- a/userspace/libsinsp/CMakeLists.txt +++ b/userspace/libsinsp/CMakeLists.txt @@ -270,8 +270,14 @@ if(NOT WIN32) ) if(NOT MUSL_OPTIMIZED_BUILD) - target_link_libraries(sinsp INTERFACE rt anl) - list(APPEND SINSP_PKGCONFIG_LIBRARIES rt anl) + find_library(LIB_ANL anl) + if(LIB_ANL) + target_link_libraries(sinsp INTERFACE rt anl) + list(APPEND SINSP_PKGCONFIG_LIBRARIES rt anl) + else() + target_link_libraries(sinsp INTERFACE rt) + list(APPEND SINSP_PKGCONFIG_LIBRARIES rt) + endif() endif() else()