/
CMakeLists.txt
63 lines (46 loc) · 2.43 KB
/
CMakeLists.txt
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# Copyright (c) Facebook, Inc.
# Licensed under the Apache License, Version 2.0 (the "License")
include_directories(${CMAKE_BINARY_DIR}/src/cc)
include_directories(${CMAKE_SOURCE_DIR}/src/cc)
include_directories(${CMAKE_SOURCE_DIR}/src/cc/api)
include_directories(${CMAKE_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)
add_executable(HelloWorld HelloWorld.cc)
target_link_libraries(HelloWorld bcc-static)
add_executable(CPUDistribution CPUDistribution.cc)
target_link_libraries(CPUDistribution bcc-static)
add_executable(RecordMySQLQuery RecordMySQLQuery.cc)
target_link_libraries(RecordMySQLQuery bcc-static)
add_executable(TCPSendStack TCPSendStack.cc)
target_link_libraries(TCPSendStack bcc-static)
add_executable(RandomRead RandomRead.cc)
target_link_libraries(RandomRead bcc-static)
add_executable(LLCStat LLCStat.cc)
target_link_libraries(LLCStat bcc-static)
add_executable(FollyRequestContextSwitch FollyRequestContextSwitch.cc)
target_link_libraries(FollyRequestContextSwitch bcc-static)
add_executable(UseExternalMap UseExternalMap.cc)
target_link_libraries(UseExternalMap bcc-static)
add_executable(CGroupTest CGroupTest.cc)
target_link_libraries(CGroupTest bcc-static)
add_executable(TaskIterator TaskIterator.cc)
target_link_libraries(TaskIterator bcc-static)
add_executable(SkLocalStorageIterator SkLocalStorageIterator.cc)
target_link_libraries(SkLocalStorageIterator bcc-static)
add_executable(KFuncExample KFuncExample.cc)
target_link_libraries(KFuncExample bcc-static)
if(INSTALL_CPP_EXAMPLES)
install (TARGETS HelloWorld DESTINATION share/bcc/examples/cpp)
install (TARGETS CPUDistribution DESTINATION share/bcc/examples/cpp)
install (TARGETS RecordMySQLQuery DESTINATION share/bcc/examples/cpp)
install (TARGETS TCPSendStack DESTINATION share/bcc/examples/cpp)
install (TARGETS RandomRead DESTINATION share/bcc/examples/cpp)
install (TARGETS LLCStat DESTINATION share/bcc/examples/cpp)
install (TARGETS FollyRequestContextSwitch DESTINATION share/bcc/examples/cpp)
install (TARGETS UseExternalMap DESTINATION share/bcc/examples/cpp)
install (TARGETS CGroupTest DESTINATION share/bcc/examples/cpp)
install (TARGETS KFuncExample DESTINATION share/bcc/examples/cpp)
endif(INSTALL_CPP_EXAMPLES)
add_subdirectory(pyperf)