-
Notifications
You must be signed in to change notification settings - Fork 5
/
CMakeLists.txt
105 lines (96 loc) · 2.65 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
cmake_minimum_required(VERSION 3.13)
project(spectatord)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED True)
#-- Conan 1.x support for MacOS >= 14.7 compilers is not ready yet
set(CONAN_DISABLE_CHECK_COMPILER True)
add_compile_options(-fno-omit-frame-pointer "$<$<CONFIG:Debug>:-fsanitize=address>")
add_link_options(-fno-omit-frame-pointer "$<$<CONFIG:Debug>:-fsanitize=address>")
include(CTest)
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup()
add_subdirectory(admin)
add_subdirectory(bench)
add_subdirectory(metatron)
add_subdirectory(server)
add_subdirectory(spectator)
add_subdirectory(tools)
add_subdirectory(util)
#-- spectator_test test executable
file(GLOB spectator_test_source_files
"bin/test_main.cc"
"spectator/*test.cc"
"spectator/http_server.*"
"spectator/test_utils.*"
)
add_executable(spectator_test ${spectator_test_source_files})
target_include_directories(spectator_test PRIVATE ${CMAKE_SOURCE_DIR})
target_link_libraries(spectator_test
sample_cfg
spectator
util
${CONAN_LIBS}
)
add_test(
NAME spectator_test
COMMAND spectator_test
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
)
#-- spectatord_test test executable
add_executable(spectatord_test
"admin/admin_server_test.cc"
"bin/test_main.cc"
"server/proc_utils_test.cc"
"server/spectatord_test.cc"
"spectator/test_utils.cc"
"spectator/test_utils.h"
)
target_include_directories(spectatord_test PRIVATE ${CMAKE_SOURCE_DIR})
target_link_libraries(spectatord_test
admin_server
spectatord
${CONAN_LIBS}
)
add_test(
NAME spectatord_test
COMMAND spectatord_test
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
)
#-- spectatord_main executable
option(NFLX_INTERNAL "Netflix internal build" OFF)
add_executable(spectatord_main "bin/spectatord_main.cc")
target_include_directories(spectatord_main PRIVATE
${CMAKE_SOURCE_DIR}
${CMAKE_SOURCE_DIR}/server
)
if(NFLX_INTERNAL)
message(STATUS "Using Netflix config")
target_link_libraries(spectatord_main
netflix_cfg
spectatord
admin_server
${CONAN_LIBS}
)
else()
message(STATUS "Using sample config")
target_link_libraries(spectatord_main
sample_cfg
spectatord
admin_server
${CONAN_LIBS}
)
endif()
target_link_options(spectatord_main PRIVATE
"$<$<CONFIG:Release>:-static-libstdc++>"
)
#-- metrics_gen executable
add_executable(metrics_gen
"server/local.h"
"tools/metrics_gen.cc"
)
target_include_directories(metrics_gen PRIVATE
${CMAKE_SOURCE_DIR}
${CMAKE_SOURCE_DIR}/server
)
target_link_libraries(metrics_gen ${CONAN_LIBS})
target_link_options(metrics_gen PRIVATE -pthread)