Skip to content

Commit

Permalink
make -lrt linking optional
Browse files Browse the repository at this point in the history
On Android there is no standalone rt library and relevant symbols are provided
by libc (bionic).
  • Loading branch information
Michał Gregorczyk authored and yonghong-song committed Mar 28, 2020
1 parent 85f5e7d commit e323254
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion introspection/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,14 @@ include_directories(${CMAKE_SOURCE_DIR}/src/cc/api)
include_directories(${CMAKE_SOURCE_DIR}/src/cc/libbpf/include/uapi)

option(INSTALL_INTROSPECTION "Install BPF introspection tools" ON)
option(BPS_LINK_RT "Pass -lrt to linker when linking bps tool" ON)

set(bps_libs_to_link bpf-static elf z)
if(BPS_LINK_RT)
list(APPEND bps_libs_to_link rt)
endif()

add_executable(bps bps.c)
target_link_libraries(bps bpf-static elf rt z)
target_link_libraries(bps ${bps_libs_to_link})

install (TARGETS bps DESTINATION share/bcc/introspection)

0 comments on commit e323254

Please sign in to comment.