1# Copyright (c) Facebook, Inc. 2# Licensed under the Apache License, Version 2.0 (the "License") 3 4include_directories(${PROJECT_SOURCE_DIR}/src/cc) 5include_directories(${PROJECT_SOURCE_DIR}/src/cc/api) 6include_directories(${PROJECT_SOURCE_DIR}/src/cc/libbpf/include/uapi) 7 8option(INSTALL_INTROSPECTION "Install BPF introspection tools" ON) 9option(BPS_LINK_RT "Pass -lrt to linker when linking bps tool" ON) 10 11# Note that the order matters! bpf-static first, the rest later 12if(CMAKE_USE_LIBBPF_PACKAGE AND LIBBPF_FOUND) 13set(bps_libs_to_link bpf-shared ${LIBBPF_LIBRARIES}) 14else() 15set(bps_libs_to_link bpf-static) 16endif() 17list(APPEND bps_libs_to_link elf z) 18if(BPS_LINK_RT) 19list(APPEND bps_libs_to_link rt) 20endif() 21 22add_executable(bps bps.c) 23target_link_libraries(bps ${bps_libs_to_link}) 24 25install (TARGETS bps DESTINATION share/bcc/introspection) 26