-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
214 lines (203 loc) · 6.42 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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
cmake_minimum_required (VERSION 3.2)
project (syncspirit)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_VISIBILITY_PRESET hidden)
set(CMAKE_VISIBILITY_INLINES_HIDDEN 1)
cmake_policy(SET CMP0063 NEW)
cmake_policy(SET CMP0077 NEW)
include(GenerateExportHeader)
set(CMAKE_POSITION_INDEPENDENT_CODE True)
find_package(
Boost
COMPONENTS
iostreams
filesystem
program_options
system
REQUIRED
)
find_package(OpenSSL REQUIRED)
find_package(Protobuf REQUIRED)
find_package(ZLIB REQUIRED)
find_package(rotor COMPONENTS asio thread REQUIRED)
find_package(lz4 REQUIRED)
find_package(fmt REQUIRED)
find_package(spdlog REQUIRED)
find_package(pugixml REQUIRED)
find_package(uriparser REQUIRED)
find_package(tomlplusplus REQUIRED)
find_package(nlohmann_json REQUIRED)
set(SYNCSPIRIT_VERSION "v0.3.3")
configure_file(misc/syncspirit-config.h.in include/syncspirit-config.h @ONLY)
set(Protobuf_IMPORT_DIRS ${syncspirit_SOURCE_DIR}/src/protobuf)
protobuf_generate_cpp(
PROTO_SRCS PROTO_HDRS
EXPORT_MACRO SYNCSPIRIT_API
src/protobuf/bep.proto
src/protobuf/structs.proto
)
add_library(syncspirit_pb ${PROTO_SRCS})
generate_export_header(syncspirit_pb
EXPORT_MACRO_NAME SYNCSPIRIT_API
EXPORT_FILE_NAME include/syncspirit-export.h
)
target_compile_options(syncspirit_pb PRIVATE
-include ${CMAKE_CURRENT_BINARY_DIR}/include/syncspirit-export.h
)
target_include_directories(syncspirit_pb PUBLIC
${Protobuf_INCLUDE_DIRS}
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_BINARY_DIR}/include
)
target_link_libraries(syncspirit_pb protobuf::libprotobuf)
add_library(syncspirit_lib
src/constants.cpp
src/config/utils.cpp
src/db/cursor.cpp
src/db/error_code.cpp
src/db/prefix.cpp
src/db/transaction.cpp
src/db/utils.cpp
src/fs/chunk_iterator.cpp
src/fs/file.cpp
src/fs/file_actor.cpp
src/fs/fs_supervisor.cpp
src/fs/new_chunk_iterator.cpp
src/fs/scan_actor.cpp
src/fs/scan_task.cpp
src/fs/utils.cpp
src/hasher/hasher_actor.cpp
src/hasher/hasher_proxy_actor.cpp
src/hasher/hasher_supervisor.cpp
src/model/diff/aggregate.cpp
src/model/diff/base_diff.cpp
src/model/diff/block_diff.cpp
src/model/diff/block_visitor.cpp
src/model/diff/contact_diff.cpp
src/model/diff/contact_visitor.cpp
src/model/diff/cluster_diff.cpp
src/model/diff/cluster_visitor.cpp
src/model/diff/load/blocks.cpp
src/model/diff/load/close_transaction.cpp
src/model/diff/load/devices.cpp
src/model/diff/load/file_infos.cpp
src/model/diff/load/folder_infos.cpp
src/model/diff/load/folders.cpp
src/model/diff/load/ignored_devices.cpp
src/model/diff/load/ignored_folders.cpp
src/model/diff/load/load_cluster.cpp
src/model/diff/load/unknown_folders.cpp
src/model/diff/modify/append_block.cpp
src/model/diff/modify/block_ack.cpp
src/model/diff/modify/block_rej.cpp
src/model/diff/modify/block_transaction.cpp
src/model/diff/modify/blocks_availability.cpp
src/model/diff/modify/clone_block.cpp
src/model/diff/modify/clone_file.cpp
src/model/diff/modify/connect_request.cpp
src/model/diff/modify/create_folder.cpp
src/model/diff/modify/file_availability.cpp
src/model/diff/modify/finish_file.cpp
src/model/diff/modify/finish_file_ack.cpp
src/model/diff/modify/lock_file.cpp
src/model/diff/modify/mark_reachable.cpp
src/model/diff/modify/local_update.cpp
src/model/diff/modify/relay_connect_request.cpp
src/model/diff/modify/share_folder.cpp
src/model/diff/modify/unshare_folder.cpp
src/model/diff/modify/update_contact.cpp
src/model/diff/modify/update_peer.cpp
src/model/diff/peer/peer_state.cpp
src/model/diff/peer/cluster_remove.cpp
src/model/diff/peer/cluster_update.cpp
src/model/diff/peer/update_folder.cpp
src/model/misc/block_iterator.cpp
src/model/misc/error_code.cpp
src/model/misc/file_block.cpp
src/model/misc/file_iterator.cpp
src/model/misc/updates_streamer.cpp
src/model/misc/uuid.cpp
src/model/misc/version_utils.cpp
src/model/block_info.cpp
src/model/cluster.cpp
src/model/device.cpp
src/model/device_id.cpp
src/model/file_info.cpp
src/model/folder.cpp
src/model/folder_data.cpp
src/model/folder_info.cpp
src/model/ignored_device.cpp
src/model/ignored_folder.cpp
src/model/remote_folder_info.cpp
src/model/unknown_folder.cpp
src/net/acceptor_actor.cpp
src/net/cluster_supervisor.cpp
src/net/controller_actor.cpp
src/net/db_actor.cpp
src/net/dialer_actor.cpp
src/net/global_discovery_actor.cpp
src/net/http_actor.cpp
src/net/initiator_actor.cpp
src/net/local_discovery_actor.cpp
src/net/messages.cpp
src/net/net_supervisor.cpp
src/net/peer_actor.cpp
src/net/peer_supervisor.cpp
src/net/relay_actor.cpp
src/net/resolver_actor.cpp
src/net/names.cpp
src/net/ssdp_actor.cpp
src/net/upnp_actor.cpp
src/proto/bep_support.cpp
src/proto/discovery_support.cpp
src/proto/luhn32.cpp
src/proto/relay_support.cpp
src/proto/upnp_support.cpp
src/transport/stream.cpp
src/transport/http.cpp
src/utils/base32.cpp
src/utils/beast_support.cpp
src/utils/error_code.cpp
src/utils/location.cpp
src/utils/log.cpp
src/utils/network_interface.cpp
src/utils/platform.cpp
src/utils/tls.cpp
src/utils/uri.cpp
)
set(BUILD_SHARED_LIBS false CACHE BOOL "BUILD_SHARED_LIBS")
set(MDBX_BUILD_TOOLS false CACHE BOOL "MDBX_BUILD_TOOLS")
set(MDBX_ENABLE_TESTS false CACHE BOOL "MDBX_ENABLE_TESTS")
set(MDBX_BUILD_CXX false CACHE BOOL "MDBX_BUILD_CXX")
set(MDBX_BUILD_SHARED_LIBRARY true CACHE BOOL "MDBX_BUILD_SHARED_LIBRARY")
add_subdirectory("lib/mbdx")
target_include_directories(syncspirit_lib PUBLIC
${syncspirit_SOURCE_DIR}/lib/mbdx
${OPENSSL_INCLUDE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/src
)
target_link_libraries(syncspirit_lib
syncspirit_pb
rotor::asio
rotor::thread
pugixml::pugixml
Boost::iostreams
Boost::filesystem
Boost::program_options
Boost::system
OpenSSL::SSL
fmt::fmt
spdlog::spdlog
uriparser::uriparser
tomlplusplus::tomlplusplus
nlohmann_json::nlohmann_json
lz4::lz4
$<IF:$<PLATFORM_ID:Windows>,mdbx,mdbx-static>
$<$<PLATFORM_ID:Windows>:iphlpapi>
$<$<PLATFORM_ID:Windows>:ws2_32>
)
enable_testing()
add_subdirectory("tests")
add_subdirectory("src/ui-daemon")