build: explicitly link in libelf and zlib
authorFelix Fietkau <nbd@nbd.name>
Thu, 25 Aug 2022 10:15:40 +0000 (12:15 +0200)
committerFelix Fietkau <nbd@nbd.name>
Thu, 25 Aug 2022 10:15:40 +0000 (12:15 +0200)
Signed-off-by: Felix Fietkau <nbd@nbd.name>
CMakeLists.txt

index a7e3b8adb535958e8d4252f6f5a507185d65e1d5..17760766850268be2961818c6898076cda0d134e 100644 (file)
@@ -17,10 +17,14 @@ OPTION(UBUS_SUPPORT "enable ubus support" ON)
 IF(CMAKE_SYSTEM_NAME STREQUAL "Linux")
        FIND_LIBRARY(nl nl-tiny)
        find_library(bpf NAMES bpf)
+       find_library(elf NAMES elf)
+       find_library(zlib NAMES z)
        SET(SOURCES ${SOURCES} wg-linux.c vxlan.c bpf.c rtnl.c)
 ELSE()
        SET(nl "")
        SET(bpf "")
+       SET(elf "")
+       SET(zlib "")
 ENDIF()
 IF(UBUS_SUPPORT)
   SET(SOURCES ${SOURCES} ubus.c)
@@ -34,7 +38,7 @@ ADD_LIBRARY(unet SHARED curve25519.c siphash.c sha512.c fprime.c f25519.c ed2551
 TARGET_LINK_LIBRARIES(unet ubox)
 
 ADD_EXECUTABLE(unetd ${SOURCES})
-TARGET_LINK_LIBRARIES(unetd unet ubox ${ubus} blobmsg_json ${libjson} ${nl} ${bpf})
+TARGET_LINK_LIBRARIES(unetd unet ubox ${ubus} blobmsg_json ${libjson} ${nl} ${bpf} ${elf} ${zlib})
 
 ADD_EXECUTABLE(unet-tool cli.c)
 TARGET_LINK_LIBRARIES(unet-tool unet blobmsg_json ${libjson} ubox)