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()