2019-12-12 02:32:27 +00:00
|
|
|
include(Version)
|
|
|
|
|
2023-10-16 20:53:01 +00:00
|
|
|
add_library(lokinet-cryptography
|
|
|
|
STATIC
|
2023-01-10 15:58:26 +00:00
|
|
|
crypto/crypto.cpp
|
|
|
|
crypto/encrypted_frame.cpp
|
|
|
|
crypto/types.cpp
|
|
|
|
)
|
|
|
|
|
2021-08-23 15:48:55 +00:00
|
|
|
add_library(lokinet-util
|
2021-09-18 23:54:06 +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
|
2022-10-05 18:05:25 +00:00
|
|
|
util/file.cpp
|
2019-02-15 23:04:04 +00:00
|
|
|
util/json.cpp
|
2021-03-11 01:01:43 +00:00
|
|
|
util/logging/buffer.cpp
|
2022-07-28 16:07:38 +00:00
|
|
|
util/easter_eggs.cpp
|
2019-02-09 16:16:00 +00:00
|
|
|
util/mem.cpp
|
|
|
|
util/str.cpp
|
2019-09-01 13:26:16 +00:00
|
|
|
util/thread/queue_manager.cpp
|
|
|
|
util/thread/threading.cpp
|
2021-07-29 20:40:25 +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
|
|
|
|
2023-01-10 15:58:26 +00:00
|
|
|
# lokinet-platform holds all platform specific code
|
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
|
2022-07-28 16:07:38 +00:00
|
|
|
ev/libuv.cpp
|
2022-10-06 17:50:05 +00:00
|
|
|
net/interface_info.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-06-11 16:44:05 +00:00
|
|
|
net/net_int.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-09-23 18:01:04 +00:00
|
|
|
vpn/egres_packet_router.cpp
|
2021-01-11 23:13:22 +00:00
|
|
|
vpn/platform.cpp
|
2019-02-09 16:16:00 +00:00
|
|
|
)
|
|
|
|
|
2020-05-17 19:41:48 +00:00
|
|
|
if (ANDROID)
|
2022-10-27 17:51:45 +00:00
|
|
|
target_sources(lokinet-platform PRIVATE android/ifaddrs.c util/nop_service_manager.cpp)
|
2020-05-17 19:41:48 +00:00
|
|
|
endif()
|
2019-03-05 16:21:56 +00:00
|
|
|
|
2020-05-17 19:41:48 +00:00
|
|
|
if(CMAKE_SYSTEM_NAME MATCHES "Linux")
|
2022-05-23 16:45:06 +00:00
|
|
|
target_sources(lokinet-platform PRIVATE linux/dbus.cpp)
|
2022-10-27 17:51:45 +00:00
|
|
|
if(WITH_SYSTEMD)
|
|
|
|
target_sources(lokinet-platform PRIVATE linux/sd_service_manager.cpp)
|
|
|
|
else()
|
|
|
|
target_sources(lokinet-platform PRIVATE util/nop_service_manager.cpp)
|
|
|
|
endif()
|
2019-02-11 00:02:20 +00:00
|
|
|
endif()
|
|
|
|
|
2020-05-17 19:41:48 +00:00
|
|
|
if (WIN32)
|
|
|
|
target_sources(lokinet-platform PRIVATE
|
2022-07-28 16:07:38 +00:00
|
|
|
net/win32.cpp
|
2022-09-13 16:25:27 +00:00
|
|
|
vpn/win32.cpp
|
2022-10-27 17:51:45 +00:00
|
|
|
win32/service_manager.cpp
|
2023-01-10 15:58:26 +00:00
|
|
|
win32/exec.cpp
|
2022-07-28 16:07:38 +00:00
|
|
|
win32/dll.cpp
|
2023-01-10 15:58:26 +00:00
|
|
|
win32/exception.cpp
|
|
|
|
win32/wintun.cpp
|
2022-07-28 16:07:38 +00:00
|
|
|
win32/windivert.cpp)
|
2023-01-10 15:58:26 +00:00
|
|
|
target_include_directories(lokinet-platform PRIVATE ${CMAKE_BINARY_DIR}/wintun/include/ ${CMAKE_BINARY_DIR}/WinDivert-${WINDIVERT_VERSION}/include/)
|
2022-07-28 16:07:38 +00:00
|
|
|
else()
|
|
|
|
target_sources(lokinet-platform PRIVATE
|
|
|
|
net/posix.cpp)
|
2020-05-17 19:41:48 +00:00
|
|
|
endif()
|
|
|
|
|
2023-01-10 15:58:26 +00:00
|
|
|
if(APPLE)
|
|
|
|
add_subdirectory(apple)
|
|
|
|
target_sources(lokinet-platform PRIVATE util/nop_service_manager.cpp)
|
2019-02-11 00:02:20 +00:00
|
|
|
endif()
|
2020-05-17 19:41:48 +00:00
|
|
|
|
2023-01-10 15:58:26 +00:00
|
|
|
# lokinet-dns is the dns parsing and hooking library that we use to
|
|
|
|
# parse modify and reconstitute dns wire proto, dns queries and RR
|
|
|
|
# should have no concept of dns caching, this is left as an implementation
|
|
|
|
# detail of dns resolvers (LATER: make separate lib for dns resolvers)
|
2022-07-28 16:07:38 +00:00
|
|
|
add_library(lokinet-dns
|
2021-03-26 15:55:47 +00:00
|
|
|
STATIC
|
2019-02-09 16:16:00 +00:00
|
|
|
dns/message.cpp
|
|
|
|
dns/name.cpp
|
2022-07-28 16:07:38 +00:00
|
|
|
dns/platform.cpp
|
2019-02-09 16:16:00 +00:00
|
|
|
dns/question.cpp
|
|
|
|
dns/rr.cpp
|
|
|
|
dns/serialize.cpp
|
|
|
|
dns/server.cpp
|
2022-07-28 16:07:38 +00:00
|
|
|
dns/srv_data.cpp)
|
|
|
|
|
2023-01-10 15:58:26 +00:00
|
|
|
# platform specific bits and bobs for setting dns
|
|
|
|
add_library(lokinet-dns-platform INTERFACE)
|
2022-07-28 16:07:38 +00:00
|
|
|
if(WITH_SYSTEMD)
|
2023-01-10 15:58:26 +00:00
|
|
|
add_library(lokinet-dns-systemd STATIC dns/nm_platform.cpp dns/sd_platform.cpp)
|
|
|
|
target_link_libraries(lokinet-dns-platform INTERFACE lokinet-dns-systemd)
|
2022-07-28 16:07:38 +00:00
|
|
|
endif()
|
|
|
|
|
2023-01-10 15:58:26 +00:00
|
|
|
# lokinet-nodedb holds all types and logic for storing parsing and constructing
|
|
|
|
# nodedb data published to the network and versions of it stored locally
|
|
|
|
add_library(lokinet-nodedb
|
|
|
|
STATIC
|
|
|
|
bootstrap.cpp
|
|
|
|
net/exit_info.cpp
|
|
|
|
net/traffic_policy.cpp
|
|
|
|
nodedb.cpp
|
|
|
|
pow.cpp
|
|
|
|
profiling.cpp
|
|
|
|
router_contact.cpp
|
|
|
|
router_id.cpp
|
|
|
|
router_version.cpp
|
|
|
|
)
|
|
|
|
|
|
|
|
set(BOOTSTRAP_FALLBACKS)
|
|
|
|
foreach(bs IN ITEMS MAINNET TESTNET)
|
|
|
|
if(BOOTSTRAP_FALLBACK_${bs})
|
|
|
|
message(STATUS "Building with ${bs} fallback boostrap path \"${BOOTSTRAP_FALLBACK_${bs}}\"")
|
|
|
|
file(READ "${BOOTSTRAP_FALLBACK_${bs}}" bs_data HEX)
|
|
|
|
if(bs STREQUAL TESTNET)
|
|
|
|
set(network "gamma")
|
|
|
|
elseif(bs STREQUAL MAINNET)
|
|
|
|
set(network "lokinet")
|
|
|
|
else()
|
|
|
|
string(TOLOWER "${bs}" network)
|
|
|
|
endif()
|
|
|
|
string(REGEX REPLACE "([0-9a-f][0-9a-f])" "\\\\x\\1" bs_data "${bs_data}")
|
|
|
|
set(BOOTSTRAP_FALLBACKS "${BOOTSTRAP_FALLBACKS}{\"${network}\"s, \"${bs_data}\"sv},\n")
|
|
|
|
endif()
|
|
|
|
endforeach()
|
|
|
|
configure_file("bootstrap-fallbacks.cpp.in" "${CMAKE_CURRENT_BINARY_DIR}/bootstrap-fallbacks.cpp" @ONLY)
|
|
|
|
target_sources(lokinet-nodedb PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/bootstrap-fallbacks.cpp")
|
|
|
|
|
|
|
|
# lokinet-config is for all configuration types and parsers
|
2022-07-28 16:07:38 +00:00
|
|
|
add_library(lokinet-config
|
|
|
|
STATIC
|
|
|
|
config/config.cpp
|
|
|
|
config/definition.cpp
|
|
|
|
config/ini.cpp
|
2023-10-12 20:37:45 +00:00
|
|
|
config/key_manager.cpp
|
|
|
|
)
|
2019-02-09 16:16:00 +00:00
|
|
|
|
2023-01-10 15:58:26 +00:00
|
|
|
# lokinet-consensus is for deriving and tracking network consensus state for both service nodes and clients
|
|
|
|
add_library(lokinet-consensus
|
2022-07-28 16:07:38 +00:00
|
|
|
STATIC
|
2021-06-06 12:32:23 +00:00
|
|
|
consensus/reachability_testing.cpp
|
2023-01-10 15:58:26 +00:00
|
|
|
)
|
2020-01-21 17:31:48 +00:00
|
|
|
|
2023-01-10 15:58:26 +00:00
|
|
|
# lokinet-layer-onion is the "dumb" onion routing layer with builds manages and does i/o
|
|
|
|
# with onion paths. onion paths anonymize routing layer pdu.
|
|
|
|
add_library(lokinet-layer-onion
|
|
|
|
STATIC
|
2023-09-18 21:50:07 +00:00
|
|
|
path/abstracthophandler.cpp
|
2023-01-10 15:58:26 +00:00
|
|
|
path/path_context.cpp
|
|
|
|
path/path.cpp
|
|
|
|
path/pathbuilder.cpp
|
|
|
|
path/pathset.cpp
|
|
|
|
path/transit_hop.cpp
|
|
|
|
messages/relay.cpp
|
|
|
|
)
|
|
|
|
|
|
|
|
# lokinet-layer-link is for our layer 2 analog which splits up layer 2 frames into
|
|
|
|
# a series of layer 1 symbols which are then transmitted between lokinet instances
|
|
|
|
add_library(lokinet-layer-link
|
|
|
|
STATIC
|
2023-09-14 14:54:51 +00:00
|
|
|
link/connection.cpp
|
2023-09-29 21:00:13 +00:00
|
|
|
link/contacts.cpp
|
2019-06-26 21:39:29 +00:00
|
|
|
link/link_manager.cpp
|
2023-10-12 20:37:45 +00:00
|
|
|
# link/tunnel.cpp
|
2023-01-10 15:58:26 +00:00
|
|
|
)
|
2021-03-26 15:49:30 +00:00
|
|
|
|
2023-01-10 15:58:26 +00:00
|
|
|
# lokinet-context holds the contextualized god objects for a lokinet instance
|
|
|
|
# it is what any main function would link to in practice but it is hidden behind an interface library (lokinet-amalgum)
|
|
|
|
add_library(lokinet-context
|
|
|
|
STATIC
|
|
|
|
context.cpp
|
|
|
|
link/link_manager.cpp
|
2019-06-26 21:39:29 +00:00
|
|
|
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
|
2023-01-10 15:58:26 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
# lokinet-rpc holds all rpc related compilation units
|
|
|
|
add_library(lokinet-rpc
|
|
|
|
STATIC
|
|
|
|
rpc/json_binary_proxy.cpp
|
2023-01-26 17:51:55 +00:00
|
|
|
rpc/json_conversions.cpp
|
2023-01-10 15:58:26 +00:00
|
|
|
rpc/lokid_rpc_client.cpp
|
|
|
|
rpc/rpc_request_parser.cpp
|
|
|
|
rpc/rpc_server.cpp
|
|
|
|
rpc/endpoint_rpc.cpp
|
|
|
|
)
|
|
|
|
|
|
|
|
# optional peer stats library
|
|
|
|
add_library(lokinet-peerstats
|
|
|
|
STATIC
|
|
|
|
peerstats/peer_db.cpp
|
|
|
|
peerstats/types.cpp
|
|
|
|
)
|
2022-07-28 16:07:38 +00:00
|
|
|
|
2023-01-10 15:58:26 +00:00
|
|
|
# kitchen sink to be removed after refactor
|
|
|
|
add_library(lokinet-service-deprecated-kitchensink
|
|
|
|
STATIC
|
|
|
|
endpoint_base.cpp
|
|
|
|
exit/context.cpp
|
|
|
|
exit/endpoint.cpp
|
|
|
|
exit/exit_messages.cpp
|
|
|
|
exit/policy.cpp
|
|
|
|
exit/session.cpp
|
|
|
|
handlers/exit.cpp
|
|
|
|
handlers/tun.cpp
|
|
|
|
service/name.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-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
|
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
|
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
|
|
|
|
2020-02-24 15:26:46 +00:00
|
|
|
|
2023-01-10 15:58:26 +00:00
|
|
|
# interal tooling for pybind
|
|
|
|
add_library(lokinet-tooling INTERFACE)
|
2020-02-27 20:17:37 +00:00
|
|
|
if(WITH_HIVE)
|
2023-01-10 15:58:26 +00:00
|
|
|
add_library(lokinet-hive-tooling
|
|
|
|
STATIC
|
2020-06-29 15:44:13 +00:00
|
|
|
tooling/router_hive.cpp
|
|
|
|
tooling/hive_router.cpp
|
|
|
|
tooling/hive_context.cpp
|
|
|
|
)
|
2023-01-10 15:58:26 +00:00
|
|
|
target_link_libraries(lokinet-tooling INTERFACE lokinet-hive-tooling)
|
2020-02-27 20:17:37 +00:00
|
|
|
endif()
|
|
|
|
|
2023-01-10 15:58:26 +00:00
|
|
|
# interface library for setting commone includes, linkage and flags.
|
|
|
|
add_library(lokinet-base INTERFACE)
|
|
|
|
target_include_directories(lokinet-base
|
|
|
|
INTERFACE ${PROJECT_SOURCE_DIR} ${PROJECT_SOURCE_DIR}/include
|
|
|
|
)
|
2023-10-16 20:53:01 +00:00
|
|
|
target_link_libraries(lokinet-base INTERFACE quic)
|
2023-01-10 15:58:26 +00:00
|
|
|
|
|
|
|
if(WITH_PEERSTATS)
|
|
|
|
target_compile_definitions(lokinet-base INTERFACE -DLOKINET_PEERSTATS_BACKEND)
|
|
|
|
target_link_libraries(lokinet-base INTERFACE sqlite_orm)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
# interface libraries for internal linkage
|
|
|
|
add_library(lokinet-layers INTERFACE)
|
|
|
|
add_library(lokinet-amalgum INTERFACE)
|
|
|
|
|
|
|
|
# helper function to link a library to lokinet-base, enable lto, add to lokinet-amalgum and then link to other libs
|
|
|
|
function(lokinet_link_lib libname)
|
|
|
|
message(DEBUG "created target: ${libname}")
|
|
|
|
enable_lto(${libname})
|
|
|
|
target_link_libraries(${libname} PUBLIC lokinet-base ${ARGN})
|
|
|
|
target_link_libraries(lokinet-amalgum INTERFACE ${libname})
|
|
|
|
endfunction()
|
|
|
|
|
|
|
|
# internal public linkages of components
|
2023-10-16 20:53:01 +00:00
|
|
|
lokinet_link_lib(lokinet-util lokinet-libntrup)
|
2023-01-10 15:58:26 +00:00
|
|
|
lokinet_link_lib(lokinet-cryptography lokinet-libcrypt lokinet-util)
|
|
|
|
lokinet_link_lib(lokinet-peerstats lokinet-context)
|
|
|
|
lokinet_link_lib(lokinet-consensus lokinet-context)
|
|
|
|
lokinet_link_lib(lokinet-layer-link lokinet-peerstats)
|
|
|
|
|
|
|
|
if(TARGET lokinet-hive-tooling)
|
|
|
|
lokinet_link_lib(lokinet-hive-tooling lokinet-context)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(TARGET lokinet-dns-systemd)
|
|
|
|
lokinet_link_lib(lokinet-dns-systemd
|
|
|
|
lokinet-dns
|
2022-07-16 00:41:14 +00:00
|
|
|
lokinet-platform
|
2023-01-10 15:58:26 +00:00
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
lokinet_link_lib(lokinet-platform lokinet-util)
|
|
|
|
|
|
|
|
lokinet_link_lib(lokinet-config
|
|
|
|
lokinet-util
|
|
|
|
lokinet-nodedb
|
|
|
|
lokinet-dns
|
|
|
|
lokinet-platform
|
|
|
|
)
|
|
|
|
|
|
|
|
lokinet_link_lib(lokinet-context
|
|
|
|
lokinet-config
|
|
|
|
lokinet-platform
|
|
|
|
lokinet-peerstats
|
|
|
|
lokinet-layers
|
|
|
|
lokinet-consensus
|
|
|
|
lokinet-rpc
|
|
|
|
)
|
|
|
|
|
2023-10-12 20:37:45 +00:00
|
|
|
lokinet_link_lib(
|
2023-01-10 15:58:26 +00:00
|
|
|
lokinet-platform
|
|
|
|
lokinet-config
|
|
|
|
)
|
|
|
|
|
|
|
|
lokinet_link_lib(lokinet-dns
|
|
|
|
lokinet-platform
|
|
|
|
lokinet-dns-platform
|
|
|
|
lokinet-config
|
|
|
|
)
|
|
|
|
|
|
|
|
lokinet_link_lib(lokinet-nodedb
|
|
|
|
lokinet-util
|
|
|
|
lokinet-platform
|
|
|
|
)
|
|
|
|
|
|
|
|
lokinet_link_lib(lokinet-util
|
|
|
|
lokinet-nodedb
|
|
|
|
lokinet-platform
|
|
|
|
)
|
|
|
|
|
|
|
|
lokinet_link_lib(lokinet-rpc
|
|
|
|
lokinet-context
|
|
|
|
lokinet-peerstats
|
|
|
|
lokinet-util
|
|
|
|
)
|
|
|
|
|
|
|
|
# inter lokinet-layer public/private linkage.
|
|
|
|
# when linking each layer, we consider the layer directly below private linkage and the layer above public linkage.
|
|
|
|
# this lets us hide functionality of layers below us when depended on by another component.
|
|
|
|
#
|
|
|
|
# from highest to lowest layer, the above layers are stacked as follows:
|
|
|
|
#
|
|
|
|
# platform (what lokinet snapps interact with, be it l3 os interaction or embedded lokinet)
|
|
|
|
# flow (how we want to route and stripe over our onion routing)
|
|
|
|
# routing (what we are onion routing)
|
|
|
|
# onion (how the onion routing happens)
|
|
|
|
# link (what we want to send over the wire and to where)
|
|
|
|
# wire (what is actually sent over the wire)
|
|
|
|
#
|
|
|
|
function(link_lokinet_layers)
|
|
|
|
set(lib ${ARGV0})
|
|
|
|
if(${ARGC} GREATER 1)
|
|
|
|
lokinet_link_lib(${ARGV1} ${lib})
|
|
|
|
list(REMOVE_AT ARGV 1)
|
|
|
|
target_link_libraries(${lib} PRIVATE ${ARGV1})
|
|
|
|
# recursion :D
|
|
|
|
link_lokinet_layers(${ARGV})
|
|
|
|
else()
|
|
|
|
lokinet_link_lib(${lib})
|
|
|
|
endif()
|
|
|
|
endfunction()
|
|
|
|
|
|
|
|
link_lokinet_layers(
|
|
|
|
lokinet-layer-onion
|
|
|
|
lokinet-layer-link
|
|
|
|
)
|
|
|
|
|
|
|
|
# set me to OFF to disable old codepath
|
|
|
|
set(use_old_impl ON)
|
|
|
|
if(use_old_impl)
|
|
|
|
# flow layer deprecated-kitchensink (remove me after refactor)
|
|
|
|
lokinet_link_lib(lokinet-service-deprecated-kitchensink
|
2022-07-28 16:07:38 +00:00
|
|
|
lokinet-dns
|
2023-01-10 15:58:26 +00:00
|
|
|
lokinet-nodedb
|
|
|
|
lokinet-context
|
|
|
|
lokinet-layer-onion
|
|
|
|
lokinet-platform
|
|
|
|
lokinet-rpc
|
|
|
|
)
|
|
|
|
target_link_libraries(lokinet-layers INTERFACE lokinet-service-deprecated-kitchensink)
|
2022-04-01 17:18:18 +00:00
|
|
|
endif()
|
2019-03-11 13:01:53 +00:00
|
|
|
|
2023-01-10 15:58:26 +00:00
|
|
|
target_link_libraries(lokinet-layers INTERFACE
|
|
|
|
lokinet-layer-onion
|
|
|
|
lokinet-layer-link
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
# per component external deps
|
|
|
|
|
|
|
|
target_link_libraries(lokinet-config PUBLIC oxenmq::oxenmq)
|
|
|
|
target_link_libraries(lokinet-platform PUBLIC oxenmq::oxenmq)
|
|
|
|
target_link_libraries(lokinet-dns PUBLIC libunbound)
|
|
|
|
|
|
|
|
target_link_libraries(lokinet-cryptography PUBLIC
|
|
|
|
oxenc::oxenc
|
|
|
|
sodium
|
|
|
|
)
|
|
|
|
|
|
|
|
target_link_libraries(lokinet-context PUBLIC
|
|
|
|
CLI11
|
|
|
|
oxenmq::oxenmq
|
|
|
|
uvw
|
|
|
|
)
|
|
|
|
|
|
|
|
target_link_libraries(lokinet-platform PUBLIC
|
|
|
|
Threads::Threads
|
|
|
|
base_libs
|
|
|
|
uvw
|
|
|
|
)
|
|
|
|
|
|
|
|
target_link_libraries(lokinet-util PUBLIC
|
|
|
|
nlohmann_json::nlohmann_json
|
2023-07-31 15:49:06 +00:00
|
|
|
# filesystem
|
2023-01-10 15:58:26 +00:00
|
|
|
oxenc::oxenc
|
|
|
|
)
|
|
|
|
|
2023-10-12 20:37:45 +00:00
|
|
|
target_link_libraries(lokinet-layer-link PUBLIC
|
2023-08-28 20:50:06 +00:00
|
|
|
quic
|
2023-01-10 15:58:26 +00:00
|
|
|
uvw
|
|
|
|
)
|
2020-05-19 18:53:03 +00:00
|
|
|
|
2023-01-10 15:58:26 +00:00
|
|
|
if(WITH_EMBEDDED_LOKINET)
|
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)
|
2022-07-28 16:07:38 +00:00
|
|
|
target_link_libraries(lokinet-shared PUBLIC lokinet-amalgum)
|
2020-05-17 19:41:48 +00:00
|
|
|
if(WIN32)
|
2021-04-19 11:19:07 +00:00
|
|
|
set(CMAKE_SHARED_LIBRARY_PREFIX_CXX "")
|
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-05-13 10:40:17 +00:00
|
|
|
if(WIN32)
|
|
|
|
target_link_libraries(lokinet-shared PUBLIC ws2_32 iphlpapi -fstack-protector)
|
|
|
|
install(TARGETS lokinet-shared DESTINATION bin COMPONENT liblokinet)
|
2022-06-22 21:56:35 +00:00
|
|
|
elseif(NOT APPLE)
|
2021-05-13 10:40:17 +00:00
|
|
|
install(TARGETS lokinet-shared LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT liblokinet)
|
|
|
|
endif()
|
2019-02-11 00:02:20 +00:00
|
|
|
endif()
|
2019-02-15 20:49:10 +00:00
|
|
|
|
2020-03-30 12:15:32 +00:00
|
|
|
file(GLOB_RECURSE docs_SRC */*.hpp *.hpp)
|
2020-03-27 15:04:13 +00:00
|
|
|
set(DOCS_SRC ${docs_SRC} PARENT_SCOPE)
|