-
Notifications
You must be signed in to change notification settings - Fork 8
/
CMakeLists.txt
55 lines (45 loc) · 1.23 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
#
# Copyright (c) 2019-present, Trail of Bits, Inc.
# All rights reserved.
#
# This source code is licensed in accordance with the terms specified in
# the LICENSE file found in the root directory of this source tree.
#
cmake_minimum_required(VERSION 3.21.4)
project("ebpf-common")
include("cmake/options.cmake")
include("cmake/settings.cmake")
add_subdirectory("libraries")
add_subdirectory("ebpf")
add_subdirectory("error")
add_subdirectory("utils")
if(EBPF_COMMON_ENABLE_TESTS)
message(STATUS "ebpf-common - Tests are enabled")
add_executable("ebpf-common-tests"
tests/main.cpp
tests/bpfmap.cpp
tests/erroror.cpp
tests/llvm_utils.cpp
tests/llvmbridge.cpp
tests/sectionmemorymanager.cpp
tests/tracepointdescriptor.cpp
tests/typedbpfmap.cpp
tests/uniqueref.cpp
)
target_link_libraries("ebpf-common-tests" PRIVATE
"ebpfcommon_cxx_settings"
"ebpf"
"error"
"utils"
"external::doctest"
)
target_include_directories("ebpf-common-tests" PRIVATE
"${CMAKE_CURRENT_SOURCE_DIR}"
)
add_custom_target(run-ebpf-common-tests
COMMAND "$<TARGET_FILE:ebpf-common-tests>"
COMMENT "Running ebpf-common tests"
)
else()
message(STATUS "ebpf-common - Tests are disabled")
endif()