-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
79 lines (63 loc) · 2.49 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
#[[
Copyright 2022 The Silkworm Authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
]]
# Tests
add_subdirectory(test)
if(NOT SILKWORM_CORE_ONLY)
# Benchmarks
add_subdirectory(benchmark)
find_package(absl REQUIRED)
find_package(CLI11 REQUIRED)
if(SILKWORM_USE_MIMALLOC)
find_package(mimalloc REQUIRED)
endif()
# Common modules for commands
add_subdirectory(common)
# State transtion and fuzzy tests runner tool
add_subdirectory(state-transition)
# Development utility tools
add_subdirectory(dev)
# Silkworm runnable components
# [=] "all-in-one" Silkworm component
set(SILKWORM_CMD_SRC
silkworm.cpp
common/db_checklist.cpp
common/db_checklist.hpp
common/db_max_readers_option.cpp
common/db_max_readers_option.hpp
common/human_size_parser_validator.hpp
common/node_options.cpp
common/node_options.hpp
common/rpcdaemon_options.cpp
common/rpcdaemon_options.hpp
common/sentry_options.cpp
common/sentry_options.hpp
common/snapshot_options.cpp
common/snapshot_options.hpp
)
set(SILKWORM_LIBRARIES silkworm_node silkworm_sync cmd_common $<$<BOOL:${MSVC}>:Kernel32.lib>)
add_executable(silkworm "${SILKWORM_CMD_SRC}")
target_link_libraries(silkworm PRIVATE ${SILKWORM_LIBRARIES})
# [=] standalone RpcDaemon component
set(RPCDAEMON_CMD_SRC rpcdaemon.cpp common/rpcdaemon_options.cpp common/rpcdaemon_options.hpp)
set(RPCDAEMON_LIBRARIES silkrpc absl::flags_parse cmd_common)
if(SILKWORM_USE_MIMALLOC)
list(APPEND RPCDAEMON_LIBRARIES mimalloc::mimalloc)
endif()
add_executable(silkrpcdaemon "${RPCDAEMON_CMD_SRC}")
target_include_directories(silkrpcdaemon PUBLIC ${CMAKE_SOURCE_DIR})
target_link_libraries(silkrpcdaemon PRIVATE ${RPCDAEMON_LIBRARIES})
# [=] standalone Sentry component
set(SENTRY_CMD_SRC sentry.cpp common/sentry_options.cpp common/sentry_options.hpp)
add_executable(sentry "${SENTRY_CMD_SRC}")
target_link_libraries(sentry PRIVATE silkworm_sentry cmd_common)
endif()