allow static build, mainly for deb and rpm pack

This commit is contained in:
Fancy Zhang
2020-07-05 22:30:36 +08:00
parent 9d2c26e765
commit 85e7bb3317
2 changed files with 7 additions and 6 deletions

View File

@@ -12,8 +12,8 @@ endif()
if (build_execsnoop_dl)
add_library(execsnoop MODULE execsnoop_share.cpp)
install(TARGETS execsnoop DESTINATION ${CMAKE_INSTALL_LIBDIR}/cgproxy/)
target_link_libraries(execsnoop PRIVATE ${LIBBPF} -lelf -lz)
else()
add_library(execsnoop execsnoop_share.cpp)
add_library(execsnoop STATIC execsnoop_share.cpp)
target_link_libraries(execsnoop PRIVATE ${LIBBPF} -l:libelf.a -l:libz.a)
endif()
target_link_libraries(execsnoop PRIVATE ${LIBBPF} -lelf -lz)