forked from iovisor/bcc
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
30 lines (23 loc) · 994 Bytes
/
CMakeLists.txt
File metadata and controls
30 lines (23 loc) · 994 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# Copyright (c) Facebook, Inc.
# Licensed under the Apache License, Version 2.0 (the "License")
include_directories(${PROJECT_BINARY_DIR}/src/cc)
include_directories(${PROJECT_SOURCE_DIR}/src/cc)
include_directories(${PROJECT_SOURCE_DIR}/src/cc/api)
include_directories(${PROJECT_SOURCE_DIR}/src/cc/libbpf/include/uapi)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
option(INSTALL_CPP_EXAMPLES "Install C++ examples. Those binaries are statically linked and can take plenty of disk space" OFF)
file(GLOB EXAMPLES *.cc)
foreach(EXAMPLE ${EXAMPLES})
get_filename_component(NAME ${EXAMPLE} NAME_WE)
add_executable(${NAME} ${EXAMPLE})
if(NOT CMAKE_USE_LIBBPF_PACKAGE)
target_link_libraries(${NAME} bcc-static)
else()
target_link_libraries(${NAME} bcc-shared)
endif()
if(INSTALL_CPP_EXAMPLES)
install (TARGETS ${NAME} DESTINATION share/bcc/examples/cpp)
endif(INSTALL_CPP_EXAMPLES)
endforeach()
add_subdirectory(pyperf)