lokinet/llarp/CMakeLists.txt

303 lines
8.8 KiB
CMake
Raw Normal View History

include(Version)
2023-10-23 22:58:58 +00:00
# Add an internal lokinet static library target, enables LTO (if enabled) on the target,
# and links it to the common lokinet-base interface.
# Invoke with the target/library name (e.g. "lokinet-foo") and list of source files, e.g.
# lokinet_add_library(lokinet-foo foo/source1.cpp foo/source2.cpp)
function(lokinet_add_library libname)
add_library(${libname} STATIC ${ARGN})
target_link_libraries(${libname} PUBLIC lokinet-base)
enable_lto(${libname})
endfunction()
lokinet_add_library(lokinet-cryptography
crypto/crypto.cpp
crypto/types.cpp
)
2023-10-19 21:59:57 +00:00
# Functional objects use by lokinet-core and other libraries
# needed by vpn/ router/ rpc/ handlers/ net/ link/
2023-10-23 22:58:58 +00:00
lokinet_add_library(lokinet-core-utils
2023-10-19 21:59:57 +00:00
endpoint_base.cpp
exit/context.cpp
exit/endpoint.cpp # handlers/exit.hpp
exit/policy.cpp # net/
2023-10-23 22:58:58 +00:00
handlers/exit.cpp # link/ exit/
handlers/tun.cpp
2023-10-19 21:59:57 +00:00
service/auth.cpp # config/
service/context.cpp
service/identity.cpp
2023-10-23 22:58:58 +00:00
service/info.cpp
2023-10-19 21:59:57 +00:00
service/intro.cpp # path
2023-10-23 22:58:58 +00:00
service/lns_tracker.cpp
2023-10-19 21:59:57 +00:00
service/name.cpp
2023-10-23 22:58:58 +00:00
service/session.cpp
2023-10-19 21:59:57 +00:00
service/tag.cpp
2023-10-23 22:58:58 +00:00
vpn/egres_packet_router.cpp
2023-10-19 21:59:57 +00:00
)
2023-10-23 22:58:58 +00:00
lokinet_add_library(lokinet-core
2023-10-19 21:59:57 +00:00
context.cpp
consensus/reachability_testing.cpp
exit/session.cpp
link/link_manager.cpp
router/router.cpp
router/route_poker.cpp
service/async_key_exchange.cpp
service/endpoint_util.cpp
service/endpoint.cpp
service/endpoint_state.cpp
service/name.cpp
service/outbound_context.cpp
service/protocol.cpp
)
2023-10-23 22:58:58 +00:00
lokinet_add_library(lokinet-rpc
rpc/endpoint_rpc.cpp
2023-10-19 21:59:57 +00:00
rpc/json_binary_proxy.cpp
rpc/json_conversions.cpp
rpc/lokid_rpc_client.cpp
rpc/rpc_request_parser.cpp
rpc/rpc_server.cpp
)
2023-10-23 22:58:58 +00:00
lokinet_add_library(lokinet-wire
2023-10-19 21:59:57 +00:00
link/connection.cpp
link/contacts.cpp
link/link_manager.cpp
# link/tunnel.cpp
)
# config, crypto, timeplace, nodedb, bootstrap.cpp, net, router
2023-10-23 22:58:58 +00:00
lokinet_add_library(lokinet-utils
2020-03-27 00:49:05 +00:00
${CMAKE_CURRENT_BINARY_DIR}/constants/version.cpp
util/bencode.cpp
util/buffer.cpp
util/file.cpp
util/logging/buffer.cpp
util/mem.cpp
util/str.cpp
2019-09-01 13:26:16 +00:00
util/thread/threading.cpp
2023-10-23 22:58:58 +00:00
util/thread/queue_manager.cpp
2023-10-19 21:59:57 +00:00
util/time.cpp
)
2023-10-23 22:58:58 +00:00
2023-10-19 21:59:57 +00:00
add_dependencies(lokinet-utils genversion)
2023-10-19 21:59:57 +00:00
# Addressing and event loop files used by lokinet-core and other libraries
# needed by rpc/ link/ service/ config/ path/ dht/
2023-10-23 22:58:58 +00:00
lokinet_add_library(lokinet-time-place
ev/ev.cpp
ev/libuv.cpp
net/ip.cpp
net/ip_address.cpp
net/ip_packet.cpp
net/ip_range.cpp
2019-06-11 16:44:05 +00:00
net/net_int.cpp
net/sock_addr.cpp
router_contact.cpp
router_contact_local.cpp
router_contact_remote.cpp
router_id.cpp
router_version.cpp # to be deleted shortly
2023-10-19 21:59:57 +00:00
service/address.cpp
service/convotag.cpp
service/intro_set.cpp
)
# lokinet-platform holds all platform specific code
2023-10-23 22:58:58 +00:00
lokinet_add_library(lokinet-platform
2023-10-19 21:59:57 +00:00
net/interface_info.cpp
vpn/packet_router.cpp
vpn/platform.cpp
)
cmake refactor Refactors many things in cmake to improve and simplify: - don't use variable indirection for target names; target names are *already* a variable of sorts. (e.g. ${UTIL_LIB} is now just lokinet-util). cmake/basic_definitions.cmake is now gone. - fix LTO enabling to use the standard cmake (3.9+) LTO mechanism rather than shoving a bunch of flag hacks through link_libraries and add_compile_options. This also now enables LTO when building a shared library (because previously the -flto hacks were only turned on in the static code for some reason). - build liblokinet as *either* shared library or static library, but not both. Building both makes things more complicated because they had different names (lokinet-shared or lokinet-static) and seems pointless: you generally want one or the other. Now there is just the liblokinet target, which will be shared or static depending on the value of BUILD_SHARED_LIBS. - Simplify lokinet-cryptography AVX2 code: just build *one* library, and add in the additional AVX2 files when possible, rather than building two and needing to merge them. - Compress STATIC_LINK and STATIC_LINK_RUNTIME into just STATIC_LINK. It makes no sense to use one of these (_RUNTIME) on Windows and the other on non-Windows when they appear to try to do the same thing. - remove a bunch of annotations from `endif(FOO)` -> `endif()`. - move all the tuntap compilation code (including OS-specific source file selection) into vendor/CMakeLists.txt and build tuntap as an intermediate OBJECT library rather than keeping a global variable in 5 different files. - move release motto define to root cmake; it made no sense being duplicated in both unix.cmake and win32.cmake - fix add_log_tag to not stomp on any existing source compile flags with its definition. Also use proper compile definition property instead of cramming it into compile flags. - make optimization/linker flags less hacky. There's no reason for us to force particular optimization flags because the cmake build type already does that (e.g. -DCMAKE_BUILD_TYPE=Release does -O3). Not doing that also silences a bunch of cmake warnings because it thinks "-O0 -g3" etc. are link libraries (which is reasonable: that's what the code was telling cmake they are). - sets the default build type to RelWithDebInfo which gives us `-O2 -g` if you don't specify a build type. - Move PIC up (so that the things loaded in unix.cmake, notably libuv, have it set). - Add a custom `curl` interface library that carries the correct link target and include paths for curl (system or bundled).
2020-05-17 19:41:48 +00:00
if (ANDROID)
target_sources(lokinet-platform PRIVATE android/ifaddrs.c util/nop_service_manager.cpp)
cmake refactor Refactors many things in cmake to improve and simplify: - don't use variable indirection for target names; target names are *already* a variable of sorts. (e.g. ${UTIL_LIB} is now just lokinet-util). cmake/basic_definitions.cmake is now gone. - fix LTO enabling to use the standard cmake (3.9+) LTO mechanism rather than shoving a bunch of flag hacks through link_libraries and add_compile_options. This also now enables LTO when building a shared library (because previously the -flto hacks were only turned on in the static code for some reason). - build liblokinet as *either* shared library or static library, but not both. Building both makes things more complicated because they had different names (lokinet-shared or lokinet-static) and seems pointless: you generally want one or the other. Now there is just the liblokinet target, which will be shared or static depending on the value of BUILD_SHARED_LIBS. - Simplify lokinet-cryptography AVX2 code: just build *one* library, and add in the additional AVX2 files when possible, rather than building two and needing to merge them. - Compress STATIC_LINK and STATIC_LINK_RUNTIME into just STATIC_LINK. It makes no sense to use one of these (_RUNTIME) on Windows and the other on non-Windows when they appear to try to do the same thing. - remove a bunch of annotations from `endif(FOO)` -> `endif()`. - move all the tuntap compilation code (including OS-specific source file selection) into vendor/CMakeLists.txt and build tuntap as an intermediate OBJECT library rather than keeping a global variable in 5 different files. - move release motto define to root cmake; it made no sense being duplicated in both unix.cmake and win32.cmake - fix add_log_tag to not stomp on any existing source compile flags with its definition. Also use proper compile definition property instead of cramming it into compile flags. - make optimization/linker flags less hacky. There's no reason for us to force particular optimization flags because the cmake build type already does that (e.g. -DCMAKE_BUILD_TYPE=Release does -O3). Not doing that also silences a bunch of cmake warnings because it thinks "-O0 -g3" etc. are link libraries (which is reasonable: that's what the code was telling cmake they are). - sets the default build type to RelWithDebInfo which gives us `-O2 -g` if you don't specify a build type. - Move PIC up (so that the things loaded in unix.cmake, notably libuv, have it set). - Add a custom `curl` interface library that carries the correct link target and include paths for curl (system or bundled).
2020-05-17 19:41:48 +00:00
endif()
cmake refactor Refactors many things in cmake to improve and simplify: - don't use variable indirection for target names; target names are *already* a variable of sorts. (e.g. ${UTIL_LIB} is now just lokinet-util). cmake/basic_definitions.cmake is now gone. - fix LTO enabling to use the standard cmake (3.9+) LTO mechanism rather than shoving a bunch of flag hacks through link_libraries and add_compile_options. This also now enables LTO when building a shared library (because previously the -flto hacks were only turned on in the static code for some reason). - build liblokinet as *either* shared library or static library, but not both. Building both makes things more complicated because they had different names (lokinet-shared or lokinet-static) and seems pointless: you generally want one or the other. Now there is just the liblokinet target, which will be shared or static depending on the value of BUILD_SHARED_LIBS. - Simplify lokinet-cryptography AVX2 code: just build *one* library, and add in the additional AVX2 files when possible, rather than building two and needing to merge them. - Compress STATIC_LINK and STATIC_LINK_RUNTIME into just STATIC_LINK. It makes no sense to use one of these (_RUNTIME) on Windows and the other on non-Windows when they appear to try to do the same thing. - remove a bunch of annotations from `endif(FOO)` -> `endif()`. - move all the tuntap compilation code (including OS-specific source file selection) into vendor/CMakeLists.txt and build tuntap as an intermediate OBJECT library rather than keeping a global variable in 5 different files. - move release motto define to root cmake; it made no sense being duplicated in both unix.cmake and win32.cmake - fix add_log_tag to not stomp on any existing source compile flags with its definition. Also use proper compile definition property instead of cramming it into compile flags. - make optimization/linker flags less hacky. There's no reason for us to force particular optimization flags because the cmake build type already does that (e.g. -DCMAKE_BUILD_TYPE=Release does -O3). Not doing that also silences a bunch of cmake warnings because it thinks "-O0 -g3" etc. are link libraries (which is reasonable: that's what the code was telling cmake they are). - sets the default build type to RelWithDebInfo which gives us `-O2 -g` if you don't specify a build type. - Move PIC up (so that the things loaded in unix.cmake, notably libuv, have it set). - Add a custom `curl` interface library that carries the correct link target and include paths for curl (system or bundled).
2020-05-17 19:41:48 +00:00
if(CMAKE_SYSTEM_NAME MATCHES "Linux")
target_sources(lokinet-platform PRIVATE linux/dbus.cpp)
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()
cmake refactor Refactors many things in cmake to improve and simplify: - don't use variable indirection for target names; target names are *already* a variable of sorts. (e.g. ${UTIL_LIB} is now just lokinet-util). cmake/basic_definitions.cmake is now gone. - fix LTO enabling to use the standard cmake (3.9+) LTO mechanism rather than shoving a bunch of flag hacks through link_libraries and add_compile_options. This also now enables LTO when building a shared library (because previously the -flto hacks were only turned on in the static code for some reason). - build liblokinet as *either* shared library or static library, but not both. Building both makes things more complicated because they had different names (lokinet-shared or lokinet-static) and seems pointless: you generally want one or the other. Now there is just the liblokinet target, which will be shared or static depending on the value of BUILD_SHARED_LIBS. - Simplify lokinet-cryptography AVX2 code: just build *one* library, and add in the additional AVX2 files when possible, rather than building two and needing to merge them. - Compress STATIC_LINK and STATIC_LINK_RUNTIME into just STATIC_LINK. It makes no sense to use one of these (_RUNTIME) on Windows and the other on non-Windows when they appear to try to do the same thing. - remove a bunch of annotations from `endif(FOO)` -> `endif()`. - move all the tuntap compilation code (including OS-specific source file selection) into vendor/CMakeLists.txt and build tuntap as an intermediate OBJECT library rather than keeping a global variable in 5 different files. - move release motto define to root cmake; it made no sense being duplicated in both unix.cmake and win32.cmake - fix add_log_tag to not stomp on any existing source compile flags with its definition. Also use proper compile definition property instead of cramming it into compile flags. - make optimization/linker flags less hacky. There's no reason for us to force particular optimization flags because the cmake build type already does that (e.g. -DCMAKE_BUILD_TYPE=Release does -O3). Not doing that also silences a bunch of cmake warnings because it thinks "-O0 -g3" etc. are link libraries (which is reasonable: that's what the code was telling cmake they are). - sets the default build type to RelWithDebInfo which gives us `-O2 -g` if you don't specify a build type. - Move PIC up (so that the things loaded in unix.cmake, notably libuv, have it set). - Add a custom `curl` interface library that carries the correct link target and include paths for curl (system or bundled).
2020-05-17 19:41:48 +00:00
if (WIN32)
target_sources(lokinet-platform PRIVATE
net/win32.cpp
2022-09-13 16:25:27 +00:00
vpn/win32.cpp
win32/service_manager.cpp
win32/exec.cpp
win32/dll.cpp
win32/exception.cpp
win32/wintun.cpp
win32/windivert.cpp)
target_include_directories(lokinet-platform PRIVATE ${CMAKE_BINARY_DIR}/wintun/include/ ${CMAKE_BINARY_DIR}/WinDivert-${WINDIVERT_VERSION}/include/)
else()
target_sources(lokinet-platform PRIVATE
net/posix.cpp)
cmake refactor Refactors many things in cmake to improve and simplify: - don't use variable indirection for target names; target names are *already* a variable of sorts. (e.g. ${UTIL_LIB} is now just lokinet-util). cmake/basic_definitions.cmake is now gone. - fix LTO enabling to use the standard cmake (3.9+) LTO mechanism rather than shoving a bunch of flag hacks through link_libraries and add_compile_options. This also now enables LTO when building a shared library (because previously the -flto hacks were only turned on in the static code for some reason). - build liblokinet as *either* shared library or static library, but not both. Building both makes things more complicated because they had different names (lokinet-shared or lokinet-static) and seems pointless: you generally want one or the other. Now there is just the liblokinet target, which will be shared or static depending on the value of BUILD_SHARED_LIBS. - Simplify lokinet-cryptography AVX2 code: just build *one* library, and add in the additional AVX2 files when possible, rather than building two and needing to merge them. - Compress STATIC_LINK and STATIC_LINK_RUNTIME into just STATIC_LINK. It makes no sense to use one of these (_RUNTIME) on Windows and the other on non-Windows when they appear to try to do the same thing. - remove a bunch of annotations from `endif(FOO)` -> `endif()`. - move all the tuntap compilation code (including OS-specific source file selection) into vendor/CMakeLists.txt and build tuntap as an intermediate OBJECT library rather than keeping a global variable in 5 different files. - move release motto define to root cmake; it made no sense being duplicated in both unix.cmake and win32.cmake - fix add_log_tag to not stomp on any existing source compile flags with its definition. Also use proper compile definition property instead of cramming it into compile flags. - make optimization/linker flags less hacky. There's no reason for us to force particular optimization flags because the cmake build type already does that (e.g. -DCMAKE_BUILD_TYPE=Release does -O3). Not doing that also silences a bunch of cmake warnings because it thinks "-O0 -g3" etc. are link libraries (which is reasonable: that's what the code was telling cmake they are). - sets the default build type to RelWithDebInfo which gives us `-O2 -g` if you don't specify a build type. - Move PIC up (so that the things loaded in unix.cmake, notably libuv, have it set). - Add a custom `curl` interface library that carries the correct link target and include paths for curl (system or bundled).
2020-05-17 19:41:48 +00:00
endif()
if(APPLE)
add_subdirectory(apple)
target_sources(lokinet-platform PRIVATE util/nop_service_manager.cpp)
2019-02-11 00:02:20 +00:00
endif()
cmake refactor Refactors many things in cmake to improve and simplify: - don't use variable indirection for target names; target names are *already* a variable of sorts. (e.g. ${UTIL_LIB} is now just lokinet-util). cmake/basic_definitions.cmake is now gone. - fix LTO enabling to use the standard cmake (3.9+) LTO mechanism rather than shoving a bunch of flag hacks through link_libraries and add_compile_options. This also now enables LTO when building a shared library (because previously the -flto hacks were only turned on in the static code for some reason). - build liblokinet as *either* shared library or static library, but not both. Building both makes things more complicated because they had different names (lokinet-shared or lokinet-static) and seems pointless: you generally want one or the other. Now there is just the liblokinet target, which will be shared or static depending on the value of BUILD_SHARED_LIBS. - Simplify lokinet-cryptography AVX2 code: just build *one* library, and add in the additional AVX2 files when possible, rather than building two and needing to merge them. - Compress STATIC_LINK and STATIC_LINK_RUNTIME into just STATIC_LINK. It makes no sense to use one of these (_RUNTIME) on Windows and the other on non-Windows when they appear to try to do the same thing. - remove a bunch of annotations from `endif(FOO)` -> `endif()`. - move all the tuntap compilation code (including OS-specific source file selection) into vendor/CMakeLists.txt and build tuntap as an intermediate OBJECT library rather than keeping a global variable in 5 different files. - move release motto define to root cmake; it made no sense being duplicated in both unix.cmake and win32.cmake - fix add_log_tag to not stomp on any existing source compile flags with its definition. Also use proper compile definition property instead of cramming it into compile flags. - make optimization/linker flags less hacky. There's no reason for us to force particular optimization flags because the cmake build type already does that (e.g. -DCMAKE_BUILD_TYPE=Release does -O3). Not doing that also silences a bunch of cmake warnings because it thinks "-O0 -g3" etc. are link libraries (which is reasonable: that's what the code was telling cmake they are). - sets the default build type to RelWithDebInfo which gives us `-O2 -g` if you don't specify a build type. - Move PIC up (so that the things loaded in unix.cmake, notably libuv, have it set). - Add a custom `curl` interface library that carries the correct link target and include paths for curl (system or bundled).
2020-05-17 19:41:48 +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
lokinet_add_library(lokinet-dns
dns/message.cpp # dns/server
2023-10-19 21:59:57 +00:00
dns/name.cpp # srv_data, question, rr
dns/platform.cpp
2023-10-19 21:59:57 +00:00
dns/question.cpp # message
dns/rr.cpp
dns/serialize.cpp
2023-10-19 21:59:57 +00:00
dns/server.cpp # handlers/exit+tun and service/endpoint
dns/srv_data.cpp
)
# platform specific bits and bobs for setting dns
add_library(lokinet-dns-platform INTERFACE)
if(WITH_SYSTEMD)
2023-10-24 20:33:40 +00:00
lokinet_add_library(lokinet-dns-systemd dns/nm_platform.cpp dns/sd_platform.cpp)
target_link_libraries(lokinet-dns-platform INTERFACE lokinet-dns-systemd)
endif()
# lokinet-nodedb holds all types and logic for storing parsing and constructing
# nodedb data published to the network and versions of it stored locally
2023-10-23 22:58:58 +00:00
lokinet_add_library(lokinet-nodedb
2023-10-19 21:59:57 +00:00
bootstrap.cpp # config, router.hpp
net/traffic_policy.cpp # config, intro_set
nodedb.cpp
2023-10-19 21:59:57 +00:00
profiling.cpp # path, router, service::endpoint
)
set(BOOTSTRAP_FALLBACKS)
foreach(bs IN ITEMS MAINNET TESTNET)
if(BOOTSTRAP_FALLBACK_${bs})
message(STATUS "Building with ${bs} fallback bootstrap path \"${BOOTSTRAP_FALLBACK_${bs}}\"")
file(READ "${BOOTSTRAP_FALLBACK_${bs}}" bs_data HEX)
if(bs STREQUAL TESTNET)
set(network "testnet")
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
2023-10-23 22:58:58 +00:00
lokinet_add_library(lokinet-config
config/config.cpp
config/definition.cpp
config/ini.cpp
2023-10-12 20:37:45 +00:00
config/key_manager.cpp
)
2023-10-19 21:59:57 +00:00
# All path objects; link directly to lokinet-core
2023-10-23 22:58:58 +00:00
lokinet_add_library(lokinet-path
path/abstracthophandler.cpp
path/path.cpp
path/path_context.cpp
path/pathbuilder.cpp
path/pathset.cpp
path/transit_hop.cpp
)
2023-10-19 21:59:57 +00:00
# Link libraries to their internals
2023-10-23 22:58:58 +00:00
target_link_libraries(lokinet-core-utils PUBLIC lokinet-dns)
target_link_libraries(lokinet-core PUBLIC lokinet-core-utils)
2023-10-19 21:59:57 +00:00
# Link lokinet-dns to alternate libraries
target_link_libraries(lokinet-dns PUBLIC lokinet-dns-platform)
2023-10-23 22:58:58 +00:00
target_link_libraries(lokinet-wire PUBLIC lokinet-time-place)
target_link_libraries(lokinet-dns PUBLIC lokinet-utils lokinet-cryptography lokinet-config)
target_link_libraries(lokinet-nodedb PUBLIC lokinet-time-place lokinet-cryptography)
2023-10-19 21:59:57 +00:00
target_link_libraries(lokinet-platform PUBLIC lokinet-cryptography)
target_link_libraries(lokinet-rpc PUBLIC lokinet-wire)
target_link_libraries(lokinet-time-place PUBLIC lokinet-utils lokinet-cryptography)
target_link_libraries(lokinet-wire PUBLIC lokinet-cryptography)
target_link_libraries(lokinet-config PUBLIC lokinet-cryptography)
2023-10-23 22:58:58 +00:00
target_link_libraries(lokinet-dns
PUBLIC
lokinet-time-place
)
2023-10-19 21:59:57 +00:00
target_link_libraries(lokinet-path
PUBLIC
lokinet-time-place
)
2023-10-19 21:59:57 +00:00
target_link_libraries(lokinet-core-utils
PUBLIC
2023-10-23 22:58:58 +00:00
lokinet-config
lokinet-platform
2023-10-23 22:58:58 +00:00
lokinet-rpc
lokinet-wire
)
2023-10-19 21:59:57 +00:00
target_link_libraries(lokinet-cryptography
PUBLIC
lokinet-libcrypt
lokinet-libntrup
)
2023-10-19 21:59:57 +00:00
target_link_libraries(lokinet-utils
PUBLIC
lokinet-cryptography
)
2023-10-19 21:59:57 +00:00
# cross linkage
target_link_libraries(lokinet-core
PUBLIC
lokinet-cryptography
2023-10-23 22:58:58 +00:00
lokinet-nodedb
lokinet-path
lokinet-rpc
lokinet-wire
)
2023-10-23 22:58:58 +00:00
target_link_libraries(lokinet-base INTERFACE oxenc::oxenc oxen::logging)
2023-10-23 22:58:58 +00:00
target_link_libraries(lokinet-rpc PUBLIC oxenmq::oxenmq)
target_link_libraries(lokinet-core PUBLIC oxenmq::oxenmq)
target_link_libraries(lokinet-config PUBLIC oxenmq::oxenmq)
2023-10-23 22:58:58 +00:00
target_link_libraries(lokinet-nodedb PUBLIC oxenmq::oxenmq)
2023-10-19 21:59:57 +00:00
target_link_libraries(lokinet-path PUBLIC oxenmq::oxenmq)
2023-10-23 22:58:58 +00:00
target_link_libraries(lokinet-time-place PUBLIC uvw)
target_link_libraries(lokinet-platform PUBLIC oxenmq::oxenmq Threads::Threads uvw)
target_link_libraries(lokinet-cryptography PUBLIC sodium)
target_link_libraries(lokinet-dns PUBLIC libunbound)
target_link_libraries(lokinet-utils PUBLIC nlohmann_json::nlohmann_json)
target_link_libraries(lokinet-wire PUBLIC oxenmq::oxenmq quic)
if(WITH_EMBEDDED_LOKINET)
include(GNUInstallDirs)
add_library(lokinet-shared SHARED lokinet_shared.cpp)
# target_link_libraries(lokinet-shared PUBLIC lokinet-amalgum)
target_link_libraries(lokinet-shared PUBLIC lokinet-core)
if(WIN32)
set(CMAKE_SHARED_LIBRARY_PREFIX_CXX "")
endif()
set_target_properties(lokinet-shared PROPERTIES OUTPUT_NAME lokinet)
if(WIN32)
target_link_libraries(lokinet-shared PUBLIC ws2_32 iphlpapi -fstack-protector)
install(TARGETS lokinet-shared DESTINATION bin COMPONENT liblokinet)
elseif(NOT APPLE)
install(TARGETS lokinet-shared LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT liblokinet)
endif()
endif()
file(GLOB_RECURSE docs_SRC */*.hpp *.hpp)
set(DOCS_SRC ${docs_SRC} PARENT_SCOPE)