-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
33 lines (26 loc) · 1.03 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
cmake_minimum_required(VERSION 3.16)
set(BPFTOOL bpftool CACHE STRING "bpftool executable")
set(PATCHELF patchelf CACHE STRING "patchelf executable")
project(scion-bpf)
find_package(Boost REQUIRED COMPONENTS json)
find_package(Threads REQUIRED)
if (NOT CMAKE_C_COMPILER_ID STREQUAL "Clang")
message(FATAL_ERROR
"BPF source files must be compiled by clang.\n"
"Specify '-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++' on the command line."
)
endif()
add_compile_options(-Wall -Werror -march=native)
# Create a copy of libbpf.so with an explicit dependency on libelf patched in, so Python's ctypes
# module loads the library correctly.
add_custom_target(libbpfpy ALL DEPENDS libbpf.so.1.3.0)
add_custom_command(
OUTPUT libbpf.so.1.3.0
COMMAND patchelf ${CMAKE_SOURCE_DIR}/libbpf/src/libbpf.so.1.3.0 --add-needed libelf.so.1
--output ${CMAKE_CURRENT_BINARY_DIR}/libbpf.so.1.3.0
)
add_subdirectory(libbpfpp)
add_subdirectory(xdp_pass)
add_subdirectory(aes)
add_subdirectory(br)
add_subdirectory(mac_offload)