2019-12-12 02:32:27 +00:00
|
|
|
include(Version)
|
|
|
|
|
2020-05-17 19:41:48 +00:00
|
|
|
add_library(lokinet-util
|
2021-03-26 15:55:47 +00:00
|
|
|
STATIC
|
2020-03-27 00:49:05 +00:00
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/constants/version.cpp
|
2019-02-09 16:16:00 +00:00
|
|
|
util/bencode.cpp
|
|
|
|
util/buffer.cpp
|
|
|
|
util/fs.cpp
|
2019-02-15 23:04:04 +00:00
|
|
|
util/json.cpp
|
2019-09-01 12:10:49 +00:00
|
|
|
util/logging/android_logger.cpp
|
2021-03-11 01:01:43 +00:00
|
|
|
util/logging/buffer.cpp
|
2019-09-01 12:10:49 +00:00
|
|
|
util/logging/file_logger.cpp
|
|
|
|
util/logging/json_logger.cpp
|
|
|
|
util/logging/logger.cpp
|
2020-02-22 23:01:36 +00:00
|
|
|
util/logging/logger_internal.cpp
|
2019-09-01 12:10:49 +00:00
|
|
|
util/logging/loglevel.cpp
|
|
|
|
util/logging/ostream_logger.cpp
|
|
|
|
util/logging/syslog_logger.cpp
|
|
|
|
util/logging/win32_logger.cpp
|
2019-11-15 19:40:43 +00:00
|
|
|
util/lokinet_init.c
|
2019-02-09 16:16:00 +00:00
|
|
|
util/mem.cpp
|
2019-03-20 23:18:32 +00:00
|
|
|
util/printer.cpp
|
2019-02-09 16:16:00 +00:00
|
|
|
util/str.cpp
|
2019-09-01 13:26:16 +00:00
|
|
|
util/thread/queue_manager.cpp
|
|
|
|
util/thread/threading.cpp
|
2019-02-09 16:16:00 +00:00
|
|
|
util/time.cpp
|
|
|
|
)
|
2020-05-17 19:41:48 +00:00
|
|
|
add_dependencies(lokinet-util genversion)
|
2019-02-09 16:16:00 +00:00
|
|
|
|
2021-03-09 21:55:10 +00:00
|
|
|
target_include_directories(lokinet-util PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${PROJECT_SOURCE_DIR}/include ${PROJECT_SOURCE_DIR})
|
2019-12-12 02:32:27 +00:00
|
|
|
|
2020-05-17 19:41:48 +00:00
|
|
|
target_link_libraries(lokinet-util PUBLIC
|
|
|
|
lokinet-cryptography
|
|
|
|
nlohmann_json::nlohmann_json
|
|
|
|
filesystem
|
|
|
|
date::date
|
2021-03-12 17:41:48 +00:00
|
|
|
oxenmq::oxenmq
|
2020-05-17 19:41:48 +00:00
|
|
|
)
|
2019-12-12 02:32:27 +00:00
|
|
|
|
2019-07-24 15:25:40 +00:00
|
|
|
if(ANDROID)
|
2020-05-17 19:41:48 +00:00
|
|
|
target_link_libraries(lokinet-util PUBLIC log)
|
2019-07-24 15:25:40 +00:00
|
|
|
endif()
|
|
|
|
|
2020-05-17 19:41:48 +00:00
|
|
|
add_library(lokinet-platform
|
2021-03-26 15:55:47 +00:00
|
|
|
STATIC
|
2021-03-08 19:19:20 +00:00
|
|
|
# for networking
|
2019-02-09 16:16:00 +00:00
|
|
|
ev/ev.cpp
|
2019-12-11 23:18:09 +00:00
|
|
|
ev/ev_libuv.cpp
|
2020-05-20 19:14:05 +00:00
|
|
|
net/ip.cpp
|
2020-05-20 19:25:57 +00:00
|
|
|
net/ip_address.cpp
|
2020-05-20 19:02:48 +00:00
|
|
|
net/ip_packet.cpp
|
2020-05-20 19:14:05 +00:00
|
|
|
net/ip_range.cpp
|
2019-02-09 16:16:00 +00:00
|
|
|
net/net.cpp
|
2019-06-11 16:44:05 +00:00
|
|
|
net/net_int.cpp
|
2020-08-21 15:07:37 +00:00
|
|
|
net/route.cpp
|
2020-05-20 19:25:57 +00:00
|
|
|
net/sock_addr.cpp
|
2021-03-02 18:18:22 +00:00
|
|
|
vpn/packet_router.cpp
|
2021-01-11 23:13:22 +00:00
|
|
|
vpn/platform.cpp
|
2019-02-09 16:16:00 +00:00
|
|
|
)
|
|
|
|
|
2021-03-02 02:06:20 +00:00
|
|
|
target_link_libraries(lokinet-platform PUBLIC lokinet-cryptography lokinet-util Threads::Threads base_libs uvw)
|
2020-05-17 19:41:48 +00:00
|
|
|
|
|
|
|
|
|
|
|
if (ANDROID)
|
|
|
|
target_sources(lokinet-platform PRIVATE android/ifaddrs.c)
|
|
|
|
endif()
|
2019-03-05 16:21:56 +00:00
|
|
|
|
2020-05-17 19:41:48 +00:00
|
|
|
if(CMAKE_SYSTEM_NAME MATCHES "Linux")
|
|
|
|
target_sources(lokinet-platform PRIVATE linux/netns.cpp)
|
2019-02-09 16:16:00 +00:00
|
|
|
|
2019-02-11 00:02:20 +00:00
|
|
|
if(NON_PC_TARGET)
|
|
|
|
add_import_library(rt)
|
2020-05-17 19:41:48 +00:00
|
|
|
target_link_libraries(lokinet-platform PUBLIC rt)
|
2019-02-11 00:02:20 +00:00
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
2020-05-17 19:41:48 +00:00
|
|
|
if (WIN32)
|
|
|
|
target_sources(lokinet-platform PRIVATE
|
|
|
|
win32/win32_inet.c
|
|
|
|
win32/win32_intrnl.c)
|
|
|
|
|
|
|
|
target_link_libraries(lokinet-platform PUBLIC iphlpapi)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
|
|
|
|
target_include_directories(lokinet-platform SYSTEM PUBLIC /usr/local/include)
|
2019-02-11 00:02:20 +00:00
|
|
|
endif()
|
2020-05-17 19:41:48 +00:00
|
|
|
|
|
|
|
add_library(liblokinet
|
2021-03-26 15:55:47 +00:00
|
|
|
STATIC
|
2020-05-20 19:25:57 +00:00
|
|
|
config/config.cpp
|
|
|
|
config/definition.cpp
|
|
|
|
config/ini.cpp
|
|
|
|
config/key_manager.cpp
|
|
|
|
|
2019-02-09 16:16:00 +00:00
|
|
|
dns/message.cpp
|
|
|
|
dns/name.cpp
|
|
|
|
dns/question.cpp
|
|
|
|
dns/rr.cpp
|
|
|
|
dns/serialize.cpp
|
|
|
|
dns/server.cpp
|
2020-08-31 20:07:17 +00:00
|
|
|
dns/srv_data.cpp
|
2020-06-09 16:59:49 +00:00
|
|
|
dns/unbound_resolver.cpp
|
2019-02-09 16:16:00 +00:00
|
|
|
|
2020-01-21 17:31:48 +00:00
|
|
|
consensus/table.cpp
|
|
|
|
|
2019-12-06 17:32:46 +00:00
|
|
|
bootstrap.cpp
|
2019-02-09 16:16:00 +00:00
|
|
|
context.cpp
|
|
|
|
crypto/crypto_libsodium.cpp
|
|
|
|
crypto/crypto.cpp
|
|
|
|
crypto/encrypted_frame.cpp
|
|
|
|
crypto/types.cpp
|
|
|
|
dht/context.cpp
|
|
|
|
dht/dht.cpp
|
|
|
|
dht/explorenetworkjob.cpp
|
|
|
|
dht/localtaglookup.cpp
|
|
|
|
dht/localrouterlookup.cpp
|
|
|
|
dht/localserviceaddresslookup.cpp
|
|
|
|
dht/message.cpp
|
|
|
|
dht/messages/findintro.cpp
|
|
|
|
dht/messages/findrouter.cpp
|
|
|
|
dht/messages/gotintro.cpp
|
|
|
|
dht/messages/gotrouter.cpp
|
|
|
|
dht/messages/pubintro.cpp
|
2020-09-17 19:18:08 +00:00
|
|
|
dht/messages/findname.cpp
|
|
|
|
dht/messages/gotname.cpp
|
2019-02-09 16:16:00 +00:00
|
|
|
dht/publishservicejob.cpp
|
|
|
|
dht/recursiverouterlookup.cpp
|
|
|
|
dht/serviceaddresslookup.cpp
|
|
|
|
dht/taglookup.cpp
|
2021-04-06 12:25:46 +00:00
|
|
|
|
|
|
|
endpoint_base.cpp
|
|
|
|
|
2019-02-09 16:16:00 +00:00
|
|
|
exit/context.cpp
|
|
|
|
exit/endpoint.cpp
|
2019-06-15 14:55:14 +00:00
|
|
|
exit/exit_messages.cpp
|
2019-02-09 16:16:00 +00:00
|
|
|
exit/policy.cpp
|
|
|
|
exit/session.cpp
|
|
|
|
handlers/exit.cpp
|
|
|
|
handlers/tun.cpp
|
2019-04-22 12:25:25 +00:00
|
|
|
hook/shell.cpp
|
2019-03-29 15:17:49 +00:00
|
|
|
iwp/iwp.cpp
|
2019-08-22 20:53:27 +00:00
|
|
|
iwp/linklayer.cpp
|
|
|
|
iwp/message_buffer.cpp
|
|
|
|
iwp/session.cpp
|
2019-06-26 21:39:29 +00:00
|
|
|
link/link_manager.cpp
|
2020-11-10 14:24:58 +00:00
|
|
|
link/session.cpp
|
2019-02-09 16:16:00 +00:00
|
|
|
link/server.cpp
|
|
|
|
messages/dht_immediate.cpp
|
|
|
|
messages/link_intro.cpp
|
2019-06-15 14:55:13 +00:00
|
|
|
messages/link_message_parser.cpp
|
2019-02-09 16:16:00 +00:00
|
|
|
messages/relay.cpp
|
|
|
|
messages/relay_commit.cpp
|
2019-06-04 18:31:17 +00:00
|
|
|
messages/relay_status.cpp
|
2019-02-09 16:16:00 +00:00
|
|
|
net/address_info.cpp
|
|
|
|
net/exit_info.cpp
|
2021-04-14 15:07:06 +00:00
|
|
|
net/traffic_policy.cpp
|
2019-02-09 16:16:00 +00:00
|
|
|
nodedb.cpp
|
2019-06-17 23:19:39 +00:00
|
|
|
path/ihophandler.cpp
|
|
|
|
path/path_context.cpp
|
|
|
|
path/path.cpp
|
2019-02-09 16:16:00 +00:00
|
|
|
path/pathbuilder.cpp
|
|
|
|
path/pathset.cpp
|
|
|
|
path/transit_hop.cpp
|
2020-05-20 17:26:45 +00:00
|
|
|
peerstats/peer_db.cpp
|
2020-05-20 21:00:10 +00:00
|
|
|
peerstats/types.cpp
|
2019-02-09 16:16:00 +00:00
|
|
|
pow.cpp
|
|
|
|
profiling.cpp
|
2021-03-26 15:49:30 +00:00
|
|
|
|
|
|
|
quic/address.cpp
|
|
|
|
quic/client.cpp
|
|
|
|
quic/connection.cpp
|
|
|
|
quic/endpoint.cpp
|
|
|
|
quic/null_crypto.cpp
|
|
|
|
quic/server.cpp
|
|
|
|
quic/stream.cpp
|
|
|
|
quic/tunnel.cpp
|
|
|
|
|
|
|
|
router_contact.cpp
|
|
|
|
router_id.cpp
|
|
|
|
router_version.cpp
|
|
|
|
service/name.cpp
|
2019-06-26 21:39:29 +00:00
|
|
|
router/outbound_message_handler.cpp
|
|
|
|
router/outbound_session_maker.cpp
|
|
|
|
router/rc_lookup_handler.cpp
|
2020-01-30 17:23:16 +00:00
|
|
|
router/rc_gossiper.cpp
|
2019-02-09 16:16:00 +00:00
|
|
|
router/router.cpp
|
2020-09-24 00:28:38 +00:00
|
|
|
router/route_poker.cpp
|
2019-02-09 16:16:00 +00:00
|
|
|
routing/dht_message.cpp
|
|
|
|
routing/message_parser.cpp
|
2019-06-19 22:30:07 +00:00
|
|
|
routing/path_confirm_message.cpp
|
|
|
|
routing/path_latency_message.cpp
|
|
|
|
routing/path_transfer_message.cpp
|
|
|
|
routing/transfer_traffic_message.cpp
|
2020-05-18 16:06:52 +00:00
|
|
|
rpc/lokid_rpc_client.cpp
|
2020-05-21 14:09:45 +00:00
|
|
|
rpc/rpc_server.cpp
|
2020-06-02 21:10:42 +00:00
|
|
|
rpc/endpoint_rpc.cpp
|
2019-02-09 16:16:00 +00:00
|
|
|
service/address.cpp
|
2019-04-21 17:41:58 +00:00
|
|
|
service/async_key_exchange.cpp
|
2020-06-02 21:10:42 +00:00
|
|
|
service/auth.cpp
|
2021-03-12 17:41:48 +00:00
|
|
|
service/convotag.cpp
|
2019-02-09 16:16:00 +00:00
|
|
|
service/context.cpp
|
2019-07-15 09:15:51 +00:00
|
|
|
service/endpoint_state.cpp
|
2019-04-30 01:06:20 +00:00
|
|
|
service/endpoint_util.cpp
|
2019-02-09 16:16:00 +00:00
|
|
|
service/endpoint.cpp
|
2019-04-21 17:41:58 +00:00
|
|
|
service/hidden_service_address_lookup.cpp
|
2019-04-22 18:35:19 +00:00
|
|
|
service/identity.cpp
|
2019-02-09 16:16:00 +00:00
|
|
|
service/info.cpp
|
2019-04-22 18:35:19 +00:00
|
|
|
service/intro_set.cpp
|
|
|
|
service/intro.cpp
|
2021-03-19 14:09:06 +00:00
|
|
|
service/lns_tracker.cpp
|
2019-02-09 16:16:00 +00:00
|
|
|
service/lookup.cpp
|
2020-09-17 19:18:08 +00:00
|
|
|
service/name.cpp
|
2019-04-21 16:44:27 +00:00
|
|
|
service/outbound_context.cpp
|
2019-02-09 16:16:00 +00:00
|
|
|
service/protocol.cpp
|
2021-04-14 15:07:06 +00:00
|
|
|
service/protocol_type.cpp
|
2019-07-15 09:15:51 +00:00
|
|
|
service/router_lookup_job.cpp
|
2019-04-19 16:02:32 +00:00
|
|
|
service/sendcontext.cpp
|
2019-04-21 18:38:30 +00:00
|
|
|
service/session.cpp
|
2020-02-27 21:16:46 +00:00
|
|
|
service/tag.cpp
|
2020-03-01 01:58:45 +00:00
|
|
|
)
|
2020-05-17 19:41:48 +00:00
|
|
|
|
|
|
|
set_target_properties(liblokinet PROPERTIES OUTPUT_NAME lokinet)
|
|
|
|
|
2021-03-26 15:49:30 +00:00
|
|
|
enable_lto(lokinet-util lokinet-platform liblokinet)
|
2020-01-17 13:22:08 +00:00
|
|
|
|
2020-02-24 15:26:46 +00:00
|
|
|
if(TRACY_ROOT)
|
2020-05-17 19:41:48 +00:00
|
|
|
target_sources(liblokinet PRIVATE ${TRACY_ROOT}/TracyClient.cpp)
|
2020-02-24 15:26:46 +00:00
|
|
|
endif()
|
|
|
|
|
2019-02-11 00:02:20 +00:00
|
|
|
if(TESTNET)
|
2020-05-17 19:41:48 +00:00
|
|
|
target_sources(liblokinet PRIVATE testnet.c)
|
2019-02-11 00:02:20 +00:00
|
|
|
endif()
|
|
|
|
|
2020-02-27 20:17:37 +00:00
|
|
|
if(WITH_HIVE)
|
2020-06-29 15:44:13 +00:00
|
|
|
target_sources(liblokinet PRIVATE
|
|
|
|
tooling/router_hive.cpp
|
|
|
|
tooling/hive_router.cpp
|
|
|
|
tooling/hive_context.cpp
|
|
|
|
)
|
2020-02-27 20:17:37 +00:00
|
|
|
endif()
|
|
|
|
|
2021-03-26 15:49:30 +00:00
|
|
|
target_link_libraries(liblokinet PUBLIC cxxopts lokinet-platform lokinet-util lokinet-cryptography sqlite_orm ngtcp2)
|
2020-06-15 22:44:59 +00:00
|
|
|
target_link_libraries(liblokinet PRIVATE libunbound)
|
2019-03-11 13:01:53 +00:00
|
|
|
|
2020-05-19 18:53:03 +00:00
|
|
|
|
2021-03-08 19:19:20 +00:00
|
|
|
if(BUILD_LIBLOKINET)
|
2020-10-28 22:26:43 +00:00
|
|
|
include(GNUInstallDirs)
|
2021-03-08 19:19:20 +00:00
|
|
|
add_library(lokinet-shared SHARED lokinet_shared.cpp)
|
2021-03-09 12:39:28 +00:00
|
|
|
target_link_libraries(lokinet-shared PUBLIC liblokinet)
|
2021-03-08 19:19:20 +00:00
|
|
|
install(TARGETS lokinet-shared LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
2020-05-17 19:41:48 +00:00
|
|
|
if(WIN32)
|
2021-04-19 11:19:07 +00:00
|
|
|
set(CMAKE_SHARED_LIBRARY_PREFIX_CXX "")
|
2021-03-09 12:39:28 +00:00
|
|
|
target_link_libraries(lokinet-shared PUBLIC ws2_32 iphlpapi -fstack-protector)
|
2019-02-11 00:02:20 +00:00
|
|
|
endif()
|
2021-04-19 11:19:07 +00:00
|
|
|
set_target_properties(lokinet-shared PROPERTIES OUTPUT_NAME lokinet)
|
2021-03-08 19:19:20 +00:00
|
|
|
add_log_tag(lokinet-shared)
|
2019-02-11 00:02:20 +00:00
|
|
|
endif()
|
2019-02-15 20:49:10 +00:00
|
|
|
|
2020-05-17 19:41:48 +00:00
|
|
|
foreach(lokinet_lib liblokinet lokinet-platform lokinet-util lokinet-cryptography)
|
|
|
|
add_log_tag(${lokinet_lib})
|
|
|
|
endforeach()
|
2020-03-27 15:04:13 +00:00
|
|
|
|
2020-03-30 12:15:32 +00:00
|
|
|
file(GLOB_RECURSE docs_SRC */*.hpp *.hpp)
|
2021-03-08 19:19:20 +00:00
|
|
|
|
2020-03-27 15:04:13 +00:00
|
|
|
set(DOCS_SRC ${docs_SRC} PARENT_SCOPE)
|