Browse Source

Add install step + example + test (#5)

* Move outcome to project

Signed-off-by: Bogdan Vaneev <warchantua@gmail.com>

* Add example

Signed-off-by: Bogdan Vaneev <warchantua@gmail.com>

* add install step

Signed-off-by: Bogdan Vaneev <warchantua@gmail.com>

* Fix

Signed-off-by: Bogdan Vaneev <warchantua@gmail.com>

* Cleanup "install"

Signed-off-by: Bogdan Vaneev <warchantua@gmail.com>

* Fix

Signed-off-by: Bogdan Vaneev <warchantua@gmail.com>
pull/12/head
Bohdan 5 years ago
committed by GitHub
parent
commit
942d3cbe43
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 9
      .github/workflows/ci.yml
  2. 89
      CMakeLists.txt
  3. 8
      cmake/Hunter/config.cmake
  4. 6
      cmake/Hunter/init.cmake
  5. 5
      cmake/dependencies.cmake
  6. 1
      cmake/functions.cmake
  7. 50
      cmake/install.cmake
  8. 33
      cmake/libp2pConfig.cmake.in
  9. 6
      cmake/libp2p_add_library.cmake
  10. 4
      deps/CMakeLists.txt
  11. 8
      deps/outcome/CMakeLists.txt
  12. 30
      example/00-install/CMakeLists.txt
  13. 10
      example/00-install/main.cpp
  14. 2
      include/libp2p/basic/closeable.hpp
  15. 2
      include/libp2p/basic/message_read_writer.hpp
  16. 2
      include/libp2p/basic/message_read_writer_error.hpp
  17. 2
      include/libp2p/basic/reader.hpp
  18. 2
      include/libp2p/common/hexutil.hpp
  19. 2
      include/libp2p/connection/stream.hpp
  20. 2
      include/libp2p/crypto/aes_provider.hpp
  21. 2
      include/libp2p/crypto/aes_provider/aes_provider_impl.hpp
  22. 2
      include/libp2p/crypto/error.hpp
  23. 2
      include/libp2p/crypto/hmac_provider.hpp
  24. 2
      include/libp2p/crypto/key_generator.hpp
  25. 2
      include/libp2p/crypto/key_validator.hpp
  26. 2
      include/libp2p/host/host.hpp
  27. 2
      include/libp2p/multi/converters/conversion_error.hpp
  28. 2
      include/libp2p/multi/converters/converter_utils.hpp
  29. 2
      include/libp2p/multi/converters/ip_v4_converter.hpp
  30. 2
      include/libp2p/multi/converters/ip_v6_converter.hpp
  31. 2
      include/libp2p/multi/converters/ipfs_converter.hpp
  32. 2
      include/libp2p/multi/converters/tcp_converter.hpp
  33. 2
      include/libp2p/multi/converters/udp_converter.hpp
  34. 2
      include/libp2p/multi/multiaddress.hpp
  35. 2
      include/libp2p/multi/multibase_codec.hpp
  36. 2
      include/libp2p/multi/multibase_codec/codecs/base16.hpp
  37. 2
      include/libp2p/multi/multibase_codec/codecs/base58.hpp
  38. 2
      include/libp2p/multi/multibase_codec/codecs/base64.hpp
  39. 2
      include/libp2p/multi/multibase_codec/codecs/base_error.hpp
  40. 2
      include/libp2p/multi/multihash.hpp
  41. 2
      include/libp2p/muxer/muxer_adaptor.hpp
  42. 2
      include/libp2p/network/listener_manager.hpp
  43. 2
      include/libp2p/network/router.hpp
  44. 0
      include/libp2p/outcome/outcome-register.hpp
  45. 2
      include/libp2p/outcome/outcome.hpp
  46. 2
      include/libp2p/peer/errors.hpp
  47. 2
      include/libp2p/peer/key_repository.hpp
  48. 2
      include/libp2p/peer/peer_address.hpp
  49. 2
      include/libp2p/peer/peer_id.hpp
  50. 2
      include/libp2p/peer/protocol_repository.hpp
  51. 2
      include/libp2p/protocol/base_protocol.hpp
  52. 2
      include/libp2p/protocol/identify/identify_msg_processor.hpp
  53. 2
      include/libp2p/protocol/ping/ping.hpp
  54. 2
      include/libp2p/protocol_muxer/multiselect/message_manager.hpp
  55. 2
      include/libp2p/protocol_muxer/multiselect/message_reader.hpp
  56. 2
      include/libp2p/protocol_muxer/multiselect/multiselect_error.hpp
  57. 2
      include/libp2p/protocol_muxer/protocol_muxer.hpp
  58. 2
      include/libp2p/security/error.hpp
  59. 2
      include/libp2p/security/security_adaptor.hpp
  60. 2
      include/libp2p/transport/tcp/tcp_util.hpp
  61. 2
      include/libp2p/transport/transport_adaptor.hpp
  62. 2
      include/libp2p/transport/upgrader.hpp
  63. 2
      src/CMakeLists.txt
  64. 10
      src/basic/CMakeLists.txt
  65. 5
      src/common/CMakeLists.txt
  66. 6
      src/crypto/CMakeLists.txt
  67. 2
      src/crypto/aes_provider/CMakeLists.txt
  68. 2
      src/crypto/hmac_provider/CMakeLists.txt
  69. 2
      src/crypto/key_generator/CMakeLists.txt
  70. 2
      src/crypto/key_marshaller/CMakeLists.txt
  71. 2
      src/crypto/key_validator/CMakeLists.txt
  72. 2
      src/crypto/random_generator/CMakeLists.txt
  73. 2
      src/crypto/sha/CMakeLists.txt
  74. 5
      src/host/basic_host/CMakeLists.txt
  75. 13
      src/multi/CMakeLists.txt
  76. 19
      src/multi/converters/CMakeLists.txt
  77. 2
      src/multi/converters/converter_utils.cpp
  78. 2
      src/multi/converters/ip_v4_converter.cpp
  79. 2
      src/multi/converters/ip_v6_converter.cpp
  80. 2
      src/multi/converters/ipfs_converter.cpp
  81. 2
      src/multi/converters/tcp_converter.cpp
  82. 2
      src/multi/converters/udp_converter.cpp
  83. 2
      src/multi/multibase_codec/CMakeLists.txt
  84. 8
      src/muxer/yamux/CMakeLists.txt
  85. 2
      src/network/CMakeLists.txt
  86. 19
      src/network/impl/CMakeLists.txt
  87. 14
      src/peer/CMakeLists.txt
  88. 2
      src/peer/address_repository/CMakeLists.txt
  89. 4
      src/peer/impl/CMakeLists.txt
  90. 2
      src/peer/key_repository/CMakeLists.txt
  91. 4
      src/peer/protocol_repository/CMakeLists.txt
  92. 2
      src/protocol/echo/CMakeLists.txt
  93. 2
      src/protocol/identify/CMakeLists.txt
  94. 4
      src/protocol/kademlia/impl/CMakeLists.txt
  95. 2
      src/protocol/ping/CMakeLists.txt
  96. 2
      src/protocol_muxer/multiselect/CMakeLists.txt
  97. 4
      src/security/CMakeLists.txt
  98. 8
      src/security/plaintext/CMakeLists.txt
  99. 10
      src/transport/impl/CMakeLists.txt
  100. 6
      src/transport/tcp/CMakeLists.txt

9
.github/workflows/main.yml → .github/workflows/ci.yml

@ -60,3 +60,12 @@ jobs:
env: env:
CTEST_OUTPUT_ON_FAILURE: 1 CTEST_OUTPUT_ON_FAILURE: 1
run: cmake --build build --target test run: cmake --build build --target test
# TODO(warchant): on CI (linux/clang) this can not be built, figure out why
# - name: install & test
# run: |
# # install libp2p and include it as a subproject through find_package
# sudo cmake --build build --target install
# cd example/00-install
# mkdir build && cd build
# cmake .. && make
# ./main

89
CMakeLists.txt

@ -13,14 +13,7 @@ set(CMAKE_TOOLCHAIN_FILE
"Default toolchain" "Default toolchain"
) )
include("cmake/Hunter/init.cmake") include("cmake/Hunter/init.cmake")
HunterGate(
URL "https://github.com/ruslo/hunter/archive/v0.23.171.tar.gz"
SHA1 "5d68bcca78eee347239ca5f4d34f4b6c12683154"
LOCAL
)
project(libp2p C CXX) project(libp2p C CXX)
include(cmake/print.cmake) include(cmake/print.cmake)
@ -28,20 +21,16 @@ print("C flags: ${CMAKE_C_FLAGS}")
print("CXX flags: ${CMAKE_CXX_FLAGS}") print("CXX flags: ${CMAKE_CXX_FLAGS}")
print("Using CMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}") print("Using CMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}")
set(THREADS_PREFER_PTHREAD_FLAG TRUE)
find_package(Threads)
link_libraries(Threads::Threads)
if (THREADS_HAVE_PTHREAD_ARG)
link_libraries(pthread)
endif ()
include(CheckCXXCompilerFlag) include(CheckCXXCompilerFlag)
include(cmake/install.cmake)
include(cmake/libp2p_add_library.cmake)
include(cmake/dependencies.cmake) include(cmake/dependencies.cmake)
include(cmake/functions.cmake) include(cmake/functions.cmake)
include(cmake/san.cmake) include(cmake/san.cmake)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON) set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
option(TESTING "Build tests" ON)
option(CLANG_FORMAT "Enable clang-format target" ON) option(CLANG_FORMAT "Enable clang-format target" ON)
option(CLANG_TIDY "Enable clang-tidy checks during compilation" OFF) option(CLANG_TIDY "Enable clang-tidy checks during compilation" OFF)
option(COVERAGE "Enable generation of coverage info" OFF) option(COVERAGE "Enable generation of coverage info" OFF)
@ -95,8 +84,6 @@ if (CLANG_FORMAT)
include(cmake/clang-format.cmake) include(cmake/clang-format.cmake)
endif () endif ()
add_subdirectory(deps)
include_directories( include_directories(
# project includes # project includes
${PROJECT_SOURCE_DIR}/include ${PROJECT_SOURCE_DIR}/include
@ -108,75 +95,13 @@ include_directories(
deps/di/include deps/di/include
deps/di/extension/include deps/di/extension/include
deps/hat-trie/include deps/hat-trie/include
deps/outcome
deps/spdlog/include deps/spdlog/include
) )
add_subdirectory(src) add_subdirectory(src)
include(GNUInstallDirs)
include(cmake/install.cmake)
install_deps_headers()
#libp2p_install(
# TARGETS
# libp2p
# libp2p_default_network
# libp2p_network
# libp2p_tcp
# libp2p_yamux
# libp2p_plaintext
# libp2p_connection_manager
# libp2p_transport_manager
# libp2p_listener_manager
# libp2p_identity_manager
# libp2p_dialer
# libp2p_router
# multiselect
# random_generator
# key_generator
# key_validator
# key_marshaller
# libp2p_tcp_connection
# libp2p_tcp_listener
# libp2p_yamuxed_connection
# libp2p_security_error
# plaintext_exchange_message_marshaller
# crypto_error
# multiaddress
# libp2p_peer_id
# uvarint
# multihash
# crypto_key
# libp2p_upgrader
# libp2p_upgrader_session
# converter_utils
# multibase_codec
# conversion_error
# converters
# hexutil
# keys_proto
# plaintext_protobuf
# logger
# sha
#)
include(CMakePackageConfigHelpers)
set(CONFIG_INCLUDE_DIRS ${CMAKE_INSTALL_FULL_INCLUDEDIR}/libp2p)
configure_package_config_file(${CMAKE_CURRENT_LIST_DIR}/cmake/libp2pConfig.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/libp2pConfig.cmake
INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/libp2p
)
install(FILES
${CMAKE_CURRENT_BINARY_DIR}/libp2pConfig.cmake
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/libp2p
)
export(PACKAGE libp2p)
enable_testing() if(TESTING)
add_subdirectory(test) enable_testing()
add_subdirectory(test)
endif()

8
cmake/Hunter/config.cmake

@ -1,4 +1,10 @@
hunter_config( hunter_config(
Boost Boost
VERSION 1.70.0-p0 VERSION 1.70.0-p0
) )
hunter_config(GSL
URL https://github.com/microsoft/GSL/archive/v2.0.0.tar.gz
SHA1 9bbdea551b38d7d09ab7aa2e89b91a66dd032b4a
CMAKE_ARGS GSL_TEST=OFF
)

6
cmake/Hunter/init.cmake

@ -27,3 +27,9 @@ set(
include(${CMAKE_CURRENT_LIST_DIR}/HunterGate.cmake) include(${CMAKE_CURRENT_LIST_DIR}/HunterGate.cmake)
HunterGate(
URL "https://github.com/cpp-pm/hunter/archive/v0.23.216.tar.gz"
SHA1 "a492a1879bee60c29f7af17ef56b45f0d7766241"
LOCAL
)

5
cmake/dependencies.cmake

@ -7,9 +7,8 @@ find_package(GMock CONFIG REQUIRED)
hunter_add_package(Boost COMPONENTS random filesystem) hunter_add_package(Boost COMPONENTS random filesystem)
find_package(Boost CONFIG REQUIRED random filesystem) find_package(Boost CONFIG REQUIRED random filesystem)
# https://docs.hunter.sh/en/latest/packages/pkg/Microsoft.GSL.html # added from hunter_config
hunter_add_package(Microsoft.GSL) hunter_add_package(GSL)
find_package(Microsoft.GSL CONFIG REQUIRED)
# https://www.openssl.org/ # https://www.openssl.org/
hunter_add_package(OpenSSL) hunter_add_package(OpenSSL)

1
cmake/functions.cmake

@ -111,6 +111,7 @@ function(add_proto_library NAME)
) )
disable_clang_tidy(${NAME}) disable_clang_tidy(${NAME})
libp2p_install(${NAME})
add_dependencies(generated ${NAME}) add_dependencies(generated ${NAME})
endfunction() endfunction()

50
cmake/install.cmake

@ -1,20 +1,7 @@
function(install_deps_headers) include(GNUInstallDirs)
install(DIRECTORY ${MICROSOFT.GSL_ROOT}/include/gsl
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
install(DIRECTORY deps/outcome/outcome function (libp2p_install targets)
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) install(TARGETS ${targets} EXPORT libp2pConfig
endfunction()
function(libp2p_install)
set(options)
set(oneValueArgs)
set(multiValueArgs TARGETS HEADER_DIRS)
cmake_parse_arguments(arg "${options}" "${oneValueArgs}"
"${multiValueArgs}" ${ARGN})
install(TARGETS ${arg_TARGETS} EXPORT libp2pTargets
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
@ -22,25 +9,14 @@ function(libp2p_install)
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
FRAMEWORK DESTINATION ${CMAKE_INSTALL_PREFIX} FRAMEWORK DESTINATION ${CMAKE_INSTALL_PREFIX}
) )
foreach (DIR IN ITEMS ${arg_HEADER_DIRS})
get_filename_component(FULL_PATH ${DIR} ABSOLUTE)
string(REPLACE ${CMAKE_CURRENT_SOURCE_DIR}/p2p libp2p RELATIVE_PATH ${FULL_PATH})
get_filename_component(INSTALL_PREFIX ${RELATIVE_PATH} DIRECTORY)
install(DIRECTORY ${DIR}
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${INSTALL_PREFIX}
FILES_MATCHING PATTERN "*.hpp")
endforeach ()
install(
EXPORT libp2pTargets
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/libp2p
NAMESPACE libp2p::
)
export(
EXPORT libp2pTargets
FILE ${CMAKE_CURRENT_BINARY_DIR}/libp2pTargets.cmake
NAMESPACE libp2p::
)
endfunction() endfunction()
install(
DIRECTORY ${CMAKE_SOURCE_DIR}/include/libp2p
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)
install(
EXPORT libp2pConfig
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/libp2p
NAMESPACE p2p::
)

33
cmake/libp2pConfig.cmake.in

@ -1,33 +0,0 @@
get_filename_component(libp2p_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
#if(NOT TARGET kagome::buffer)
# include("${kagome_CMAKE_DIR}/kagomeTargets.cmake")
#endif()
find_package(Threads)
include(GNUInstallDirs)
set(libp2p_INCLUDE_DIRS
"@CONFIG_INCLUDE_DIRS@"
)
#set(kagome_LIBRARIES
# kagome::scale
# kagome::buffer
# kagome::hexutil
# kagome::blob
# kagome::polkadot_trie_db
# kagome::polkadot_trie_codec
# kagome::polkadot_trie
# kagome::blake2
# kagome::hasher
# kagome::twox
# kagome::sha
# kagome::leveldb
# kagome::polkadot_trie_batch
# kagome::logger
# kagome::in_memory_storage
# )

6
cmake/libp2p_add_library.cmake

@ -0,0 +1,6 @@
function(libp2p_add_library target)
add_library(${target}
${ARGN}
)
libp2p_install(${target})
endfunction()

4
deps/CMakeLists.txt

@ -1,4 +0,0 @@
# Copyright Soramitsu Co., Ltd. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
add_subdirectory(outcome)

8
deps/outcome/CMakeLists.txt

@ -1,8 +0,0 @@
# Copyright Soramitsu Co., Ltd. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
add_library(outcome INTERFACE IMPORTED GLOBAL)
set_target_properties(outcome PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_CURRENT_LIST_DIR}
INTERFACE_LINK_LIBRARIES Boost::boost
)

30
example/00-install/CMakeLists.txt

@ -0,0 +1,30 @@
cmake_minimum_required(VERSION 3.12)
# reuse HunterGate...
include(${CMAKE_CURRENT_LIST_DIR}/../../cmake/Hunter/HunterGate.cmake)
HunterGate(
URL "https://github.com/cpp-pm/hunter/archive/v0.23.216.tar.gz"
SHA1 "a492a1879bee60c29f7af17ef56b45f0d7766241"
)
project(00-install C CXX)
set(CMAKE_POSITION_INDEPENDENT_CODE TRUE)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
hunter_add_package(Boost)
find_package(Boost CONFIG REQUIRED)
hunter_add_package(Microsoft.GSL)
find_package(Microsoft.GSL CONFIG REQUIRED)
# look for libp2p in OS
find_package(libp2p CONFIG REQUIRED)
add_executable(main main.cpp)
target_link_libraries(main
p2p::p2p_multiaddress
)

10
example/00-install/main.cpp

@ -0,0 +1,10 @@
#include <iostream>
#include <libp2p/multi/multiaddress.hpp>
using namespace libp2p;
int main() {
auto addr = multi::Multiaddress::create("/ip4/192.168.0.1/tcp/8080");
std::cout << "address: " << addr.value().getStringAddress() << std::endl;
return 0;
}

2
include/libp2p/basic/closeable.hpp

@ -8,7 +8,7 @@
#include <functional> #include <functional>
#include <outcome/outcome.hpp> #include <libp2p/outcome/outcome.hpp>
namespace libp2p::basic { namespace libp2p::basic {

2
include/libp2p/basic/message_read_writer.hpp

@ -11,7 +11,7 @@
#include <gsl/span> #include <gsl/span>
#include <libp2p/basic/readwriter.hpp> #include <libp2p/basic/readwriter.hpp>
#include <outcome/outcome.hpp> #include <libp2p/outcome/outcome.hpp>
namespace libp2p::basic { namespace libp2p::basic {
/** /**

2
include/libp2p/basic/message_read_writer_error.hpp

@ -6,7 +6,7 @@
#ifndef LIBP2P_MESSAGE_READ_WRITER_ERROR_HPP #ifndef LIBP2P_MESSAGE_READ_WRITER_ERROR_HPP
#define LIBP2P_MESSAGE_READ_WRITER_ERROR_HPP #define LIBP2P_MESSAGE_READ_WRITER_ERROR_HPP
#include <outcome/outcome.hpp> #include <libp2p/outcome/outcome.hpp>
namespace libp2p::basic { namespace libp2p::basic {
enum class MessageReadWriterError { enum class MessageReadWriterError {

2
include/libp2p/basic/reader.hpp

@ -11,7 +11,7 @@
#include <boost/system/error_code.hpp> #include <boost/system/error_code.hpp>
#include <gsl/span> #include <gsl/span>
#include <outcome/outcome.hpp> #include <libp2p/outcome/outcome.hpp>
namespace libp2p::basic { namespace libp2p::basic {

2
include/libp2p/common/hexutil.hpp

@ -11,7 +11,7 @@
#include <gsl/span> #include <gsl/span>
#include <outcome/outcome.hpp> #include <libp2p/outcome/outcome.hpp>
namespace libp2p::common { namespace libp2p::common {

2
include/libp2p/connection/stream.hpp

@ -9,7 +9,7 @@
#include <libp2p/basic/readwriter.hpp> #include <libp2p/basic/readwriter.hpp>
#include <libp2p/connection/capable_connection.hpp> #include <libp2p/connection/capable_connection.hpp>
#include <libp2p/multi/multiaddress.hpp> #include <libp2p/multi/multiaddress.hpp>
#include <outcome/outcome.hpp> #include <libp2p/outcome/outcome.hpp>
namespace libp2p::peer { namespace libp2p::peer {
class PeerId; class PeerId;

2
include/libp2p/crypto/aes_provider.hpp

@ -8,7 +8,7 @@
#include <libp2p/common/types.hpp> #include <libp2p/common/types.hpp>
#include <libp2p/crypto/common.hpp> #include <libp2p/crypto/common.hpp>
#include <outcome/outcome.hpp> #include <libp2p/outcome/outcome.hpp>
namespace libp2p::crypto::aes { namespace libp2p::crypto::aes {
/** /**

2
include/libp2p/crypto/aes_provider/aes_provider_impl.hpp

@ -9,7 +9,7 @@
#include <libp2p/crypto/aes_provider.hpp> #include <libp2p/crypto/aes_provider.hpp>
#include <libp2p/crypto/common.hpp> #include <libp2p/crypto/common.hpp>
#include <outcome/outcome.hpp> #include <libp2p/outcome/outcome.hpp>
namespace libp2p::crypto::aes { namespace libp2p::crypto::aes {
class AesProviderImpl : public AesProvider { class AesProviderImpl : public AesProvider {

2
include/libp2p/crypto/error.hpp

@ -6,7 +6,7 @@
#ifndef LIBP2P_CRYPTO_ERROR_HPP #ifndef LIBP2P_CRYPTO_ERROR_HPP
#define LIBP2P_CRYPTO_ERROR_HPP #define LIBP2P_CRYPTO_ERROR_HPP
#include <outcome/outcome.hpp> #include <libp2p/outcome/outcome.hpp>
namespace libp2p::crypto { namespace libp2p::crypto {
enum class CryptoProviderError { enum class CryptoProviderError {

2
include/libp2p/crypto/hmac_provider.hpp

@ -8,7 +8,7 @@
#include <libp2p/common/types.hpp> #include <libp2p/common/types.hpp>
#include <libp2p/crypto/common.hpp> #include <libp2p/crypto/common.hpp>
#include <outcome/outcome.hpp> #include <libp2p/outcome/outcome.hpp>
namespace libp2p::crypto::hmac { namespace libp2p::crypto::hmac {
/** /**

2
include/libp2p/crypto/key_generator.hpp

@ -9,7 +9,7 @@
#include <boost/filesystem.hpp> #include <boost/filesystem.hpp>
#include <libp2p/crypto/common.hpp> #include <libp2p/crypto/common.hpp>
#include <libp2p/crypto/key.hpp> #include <libp2p/crypto/key.hpp>
#include <outcome/outcome.hpp> #include <libp2p/outcome/outcome.hpp>
#include <vector> #include <vector>
namespace libp2p::crypto { namespace libp2p::crypto {

2
include/libp2p/crypto/key_validator.hpp

@ -6,7 +6,7 @@
#ifndef LIBP2P_CRYPTO_KEY_VALIDATOR_HPP #ifndef LIBP2P_CRYPTO_KEY_VALIDATOR_HPP
#define LIBP2P_CRYPTO_KEY_VALIDATOR_HPP #define LIBP2P_CRYPTO_KEY_VALIDATOR_HPP
#include <outcome/outcome.hpp> #include <libp2p/outcome/outcome.hpp>
#include <libp2p/crypto/key.hpp> #include <libp2p/crypto/key.hpp>
namespace libp2p::crypto::validator { namespace libp2p::crypto::validator {

2
include/libp2p/host/host.hpp

@ -19,7 +19,7 @@
#include <libp2p/peer/peer_repository.hpp> #include <libp2p/peer/peer_repository.hpp>
#include <libp2p/peer/protocol.hpp> #include <libp2p/peer/protocol.hpp>
#include <libp2p/protocol/base_protocol.hpp> #include <libp2p/protocol/base_protocol.hpp>
#include <outcome/outcome.hpp> #include <libp2p/outcome/outcome.hpp>
namespace libp2p { namespace libp2p {
/** /**

2
include/libp2p/multi/converters/conversion_error.hpp

@ -6,7 +6,7 @@
#ifndef LIBP2P_MULTI_CONVERTERS_CONVERSION_ERROR_HPP_ #ifndef LIBP2P_MULTI_CONVERTERS_CONVERSION_ERROR_HPP_
#define LIBP2P_MULTI_CONVERTERS_CONVERSION_ERROR_HPP_ #define LIBP2P_MULTI_CONVERTERS_CONVERSION_ERROR_HPP_
#include <outcome/outcome.hpp> #include <libp2p/outcome/outcome.hpp>
namespace libp2p::multi::converters { namespace libp2p::multi::converters {

2
include/libp2p/multi/converters/converter_utils.hpp

@ -11,7 +11,7 @@
#include <libp2p/common/types.hpp> #include <libp2p/common/types.hpp>
#include <libp2p/multi/multiaddress_protocol_list.hpp> #include <libp2p/multi/multiaddress_protocol_list.hpp>
#include <outcome/outcome.hpp> #include <libp2p/outcome/outcome.hpp>
namespace libp2p::multi::converters { namespace libp2p::multi::converters {

2
include/libp2p/multi/converters/ip_v4_converter.hpp

@ -6,7 +6,7 @@
#ifndef LIBP2P_IPV4CONVERTER_HPP #ifndef LIBP2P_IPV4CONVERTER_HPP
#define LIBP2P_IPV4CONVERTER_HPP #define LIBP2P_IPV4CONVERTER_HPP
#include <outcome/outcome.hpp> #include <libp2p/outcome/outcome.hpp>
namespace libp2p::multi::converters { namespace libp2p::multi::converters {

2
include/libp2p/multi/converters/ip_v6_converter.hpp

@ -6,7 +6,7 @@
#ifndef LIBP2P_IPV6CONVERTER_HPP #ifndef LIBP2P_IPV6CONVERTER_HPP
#define LIBP2P_IPV6CONVERTER_HPP #define LIBP2P_IPV6CONVERTER_HPP
#include <outcome/outcome.hpp> #include <libp2p/outcome/outcome.hpp>
namespace libp2p::multi::converters { namespace libp2p::multi::converters {

2
include/libp2p/multi/converters/ipfs_converter.hpp

@ -6,7 +6,7 @@
#ifndef LIBP2P_IPFS_CONVERTER_HPP #ifndef LIBP2P_IPFS_CONVERTER_HPP
#define LIBP2P_IPFS_CONVERTER_HPP #define LIBP2P_IPFS_CONVERTER_HPP
#include <outcome/outcome.hpp> #include <libp2p/outcome/outcome.hpp>
namespace libp2p::multi::converters { namespace libp2p::multi::converters {

2
include/libp2p/multi/converters/tcp_converter.hpp

@ -6,7 +6,7 @@
#ifndef LIBP2P_TCPCONVERTER_HPP #ifndef LIBP2P_TCPCONVERTER_HPP
#define LIBP2P_TCPCONVERTER_HPP #define LIBP2P_TCPCONVERTER_HPP
#include <outcome/outcome.hpp> #include <libp2p/outcome/outcome.hpp>
namespace libp2p::multi::converters { namespace libp2p::multi::converters {

2
include/libp2p/multi/converters/udp_converter.hpp

@ -6,7 +6,7 @@
#ifndef LIBP2P_UDP_CONVERTER_HPP #ifndef LIBP2P_UDP_CONVERTER_HPP
#define LIBP2P_UDP_CONVERTER_HPP #define LIBP2P_UDP_CONVERTER_HPP
#include <outcome/outcome.hpp> #include <libp2p/outcome/outcome.hpp>
namespace libp2p::multi::converters { namespace libp2p::multi::converters {

2
include/libp2p/multi/multiaddress.hpp

@ -16,7 +16,7 @@
#include <boost/optional.hpp> #include <boost/optional.hpp>
#include <libp2p/common/types.hpp> #include <libp2p/common/types.hpp>
#include <libp2p/multi/multiaddress_protocol_list.hpp> #include <libp2p/multi/multiaddress_protocol_list.hpp>
#include <outcome/outcome.hpp> #include <libp2p/outcome/outcome.hpp>
namespace libp2p::multi { namespace libp2p::multi {

2
include/libp2p/multi/multibase_codec.hpp

@ -11,7 +11,7 @@
#include <utility> #include <utility>
#include <libp2p/common/types.hpp> #include <libp2p/common/types.hpp>
#include <outcome/outcome.hpp> #include <libp2p/outcome/outcome.hpp>
namespace libp2p::multi { namespace libp2p::multi {
/** /**

2
include/libp2p/multi/multibase_codec/codecs/base16.hpp

@ -9,7 +9,7 @@
#include <optional> #include <optional>
#include <libp2p/common/types.hpp> #include <libp2p/common/types.hpp>
#include <outcome/outcome.hpp> #include <libp2p/outcome/outcome.hpp>
/** /**
* Encode/decode to/from base16 format * Encode/decode to/from base16 format

2
include/libp2p/multi/multibase_codec/codecs/base58.hpp

@ -9,7 +9,7 @@
#include <optional> #include <optional>
#include <libp2p/common/types.hpp> #include <libp2p/common/types.hpp>
#include <outcome/outcome.hpp> #include <libp2p/outcome/outcome.hpp>
/** /**
* Encode/decode to/from base58 format * Encode/decode to/from base58 format

2
include/libp2p/multi/multibase_codec/codecs/base64.hpp

@ -9,7 +9,7 @@
#include <optional> #include <optional>
#include <libp2p/common/types.hpp> #include <libp2p/common/types.hpp>
#include <outcome/outcome.hpp> #include <libp2p/outcome/outcome.hpp>
/** /**
* Encode/decode to/from base64 format * Encode/decode to/from base64 format

2
include/libp2p/multi/multibase_codec/codecs/base_error.hpp

@ -6,7 +6,7 @@
#ifndef LIBP2P_BASE_ERROR_HPP #ifndef LIBP2P_BASE_ERROR_HPP
#define LIBP2P_BASE_ERROR_HPP #define LIBP2P_BASE_ERROR_HPP
#include <outcome/outcome.hpp> #include <libp2p/outcome/outcome.hpp>
namespace libp2p::multi::detail { namespace libp2p::multi::detail {

2
include/libp2p/multi/multihash.hpp

@ -13,7 +13,7 @@
#include <gsl/span> #include <gsl/span>
#include <libp2p/common/types.hpp> #include <libp2p/common/types.hpp>
#include <libp2p/multi/hash_type.hpp> #include <libp2p/multi/hash_type.hpp>
#include <outcome/outcome.hpp> #include <libp2p/outcome/outcome.hpp>
namespace libp2p::multi { namespace libp2p::multi {

2
include/libp2p/muxer/muxer_adaptor.hpp

@ -11,7 +11,7 @@
#include <libp2p/basic/adaptor.hpp> #include <libp2p/basic/adaptor.hpp>
#include <libp2p/connection/capable_connection.hpp> #include <libp2p/connection/capable_connection.hpp>
#include <libp2p/connection/secure_connection.hpp> #include <libp2p/connection/secure_connection.hpp>
#include <outcome/outcome.hpp> #include <libp2p/outcome/outcome.hpp>
namespace libp2p::muxer { namespace libp2p::muxer {
/** /**

2
include/libp2p/network/listener_manager.hpp

@ -12,7 +12,7 @@
#include <libp2p/multi/multiaddress.hpp> #include <libp2p/multi/multiaddress.hpp>
#include <libp2p/network/router.hpp> #include <libp2p/network/router.hpp>
#include <libp2p/protocol/base_protocol.hpp> #include <libp2p/protocol/base_protocol.hpp>
#include <outcome/outcome.hpp> #include <libp2p/outcome/outcome.hpp>
namespace libp2p::network { namespace libp2p::network {

2
include/libp2p/network/router.hpp

@ -12,7 +12,7 @@
#include <libp2p/connection/stream.hpp> #include <libp2p/connection/stream.hpp>
#include <libp2p/event/bus.hpp> #include <libp2p/event/bus.hpp>
#include <libp2p/peer/protocol.hpp> #include <libp2p/peer/protocol.hpp>
#include <outcome/outcome.hpp> #include <libp2p/outcome/outcome.hpp>
namespace libp2p::network { namespace libp2p::network {

0
deps/outcome/outcome/outcome-register.hpp → include/libp2p/outcome/outcome-register.hpp

2
deps/outcome/outcome/outcome.hpp → include/libp2p/outcome/outcome.hpp

@ -12,7 +12,7 @@
#define OUTCOME_TRY(...) BOOST_OUTCOME_TRY(__VA_ARGS__) #define OUTCOME_TRY(...) BOOST_OUTCOME_TRY(__VA_ARGS__)
#include <outcome/outcome-register.hpp> #include <libp2p/outcome/outcome-register.hpp>
/** /**
* __cpp_sized_deallocation macro interferes with protobuf generated files * __cpp_sized_deallocation macro interferes with protobuf generated files

2
include/libp2p/peer/errors.hpp

@ -6,7 +6,7 @@
#ifndef LIBP2P_PEER_ERRORS_HPP #ifndef LIBP2P_PEER_ERRORS_HPP
#define LIBP2P_PEER_ERRORS_HPP #define LIBP2P_PEER_ERRORS_HPP
#include <outcome/outcome.hpp> #include <libp2p/outcome/outcome.hpp>
namespace libp2p::peer { namespace libp2p::peer {

2
include/libp2p/peer/key_repository.hpp

@ -11,7 +11,7 @@
#include <libp2p/crypto/key.hpp> #include <libp2p/crypto/key.hpp>
#include <libp2p/peer/peer_id.hpp> #include <libp2p/peer/peer_id.hpp>
#include <outcome/outcome.hpp> #include <libp2p/outcome/outcome.hpp>
namespace libp2p::peer { namespace libp2p::peer {

2
include/libp2p/peer/peer_address.hpp

@ -12,7 +12,7 @@
#include <libp2p/multi/multiaddress.hpp> #include <libp2p/multi/multiaddress.hpp>
#include <libp2p/peer/peer_info.hpp> #include <libp2p/peer/peer_info.hpp>
#include <outcome/outcome.hpp> #include <libp2p/outcome/outcome.hpp>
namespace libp2p::peer { namespace libp2p::peer {
/** /**

2
include/libp2p/peer/peer_id.hpp

@ -8,7 +8,7 @@
#include <libp2p/crypto/key.hpp> #include <libp2p/crypto/key.hpp>
#include <libp2p/multi/multihash.hpp> #include <libp2p/multi/multihash.hpp>
#include <outcome/outcome.hpp> #include <libp2p/outcome/outcome.hpp>
namespace libp2p::peer { namespace libp2p::peer {

2
include/libp2p/peer/protocol_repository.hpp

@ -14,7 +14,7 @@
#include <libp2p/basic/garbage_collectable.hpp> #include <libp2p/basic/garbage_collectable.hpp>
#include <libp2p/peer/peer_id.hpp> #include <libp2p/peer/peer_id.hpp>
#include <libp2p/peer/protocol.hpp> #include <libp2p/peer/protocol.hpp>
#include <outcome/outcome.hpp> #include <libp2p/outcome/outcome.hpp>
namespace libp2p::peer { namespace libp2p::peer {

2
include/libp2p/protocol/base_protocol.hpp

@ -8,7 +8,7 @@
#include <libp2p/basic/adaptor.hpp> #include <libp2p/basic/adaptor.hpp>
#include <libp2p/connection/stream.hpp> #include <libp2p/connection/stream.hpp>
#include <outcome/outcome.hpp> #include <libp2p/outcome/outcome.hpp>
namespace libp2p::protocol { namespace libp2p::protocol {

2
include/libp2p/protocol/identify/identify_msg_processor.hpp

@ -20,7 +20,7 @@
#include <libp2p/peer/identity_manager.hpp> #include <libp2p/peer/identity_manager.hpp>
#include <libp2p/peer/peer_id.hpp> #include <libp2p/peer/peer_id.hpp>
#include <libp2p/protocol/identify/observed_addresses.hpp> #include <libp2p/protocol/identify/observed_addresses.hpp>
#include <outcome/outcome.hpp> #include <libp2p/outcome/outcome.hpp>
namespace identify::pb { namespace identify::pb {
class Identify; class Identify;

2
include/libp2p/protocol/ping/ping.hpp

@ -14,7 +14,7 @@
#include <libp2p/host/host.hpp> #include <libp2p/host/host.hpp>
#include <libp2p/protocol/base_protocol.hpp> #include <libp2p/protocol/base_protocol.hpp>
#include <libp2p/protocol/ping/ping_config.hpp> #include <libp2p/protocol/ping/ping_config.hpp>
#include <outcome/outcome.hpp> #include <libp2p/outcome/outcome.hpp>
namespace libp2p::crypto::random { namespace libp2p::crypto::random {
class RandomGenerator; class RandomGenerator;

2
include/libp2p/protocol_muxer/multiselect/message_manager.hpp

@ -14,7 +14,7 @@
#include <libp2p/common/types.hpp> #include <libp2p/common/types.hpp>
#include <libp2p/multi/uvarint.hpp> #include <libp2p/multi/uvarint.hpp>
#include <libp2p/protocol_muxer/protocol_muxer.hpp> #include <libp2p/protocol_muxer/protocol_muxer.hpp>
#include <outcome/outcome.hpp> #include <libp2p/outcome/outcome.hpp>
namespace libp2p::protocol_muxer { namespace libp2p::protocol_muxer {
/** /**

2
include/libp2p/protocol_muxer/multiselect/message_reader.hpp

@ -8,7 +8,7 @@
#include <memory> #include <memory>
#include <outcome/outcome.hpp> #include <libp2p/outcome/outcome.hpp>
#include <libp2p/basic/readwritecloser.hpp> #include <libp2p/basic/readwritecloser.hpp>
#include <libp2p/protocol_muxer/multiselect/connection_state.hpp> #include <libp2p/protocol_muxer/multiselect/connection_state.hpp>
#include <libp2p/protocol_muxer/multiselect/message_manager.hpp> #include <libp2p/protocol_muxer/multiselect/message_manager.hpp>

2
include/libp2p/protocol_muxer/multiselect/multiselect_error.hpp

@ -6,7 +6,7 @@
#ifndef LIBP2P_MULTISELECT_ERROR_HPP #ifndef LIBP2P_MULTISELECT_ERROR_HPP
#define LIBP2P_MULTISELECT_ERROR_HPP #define LIBP2P_MULTISELECT_ERROR_HPP
#include <outcome/outcome-register.hpp> #include <libp2p/outcome/outcome-register.hpp>
namespace libp2p::protocol_muxer { namespace libp2p::protocol_muxer {
enum class MultiselectError { enum class MultiselectError {

2
include/libp2p/protocol_muxer/protocol_muxer.hpp

@ -9,7 +9,7 @@
#include <memory> #include <memory>
#include <gsl/span> #include <gsl/span>
#include <outcome/outcome.hpp> #include <libp2p/outcome/outcome.hpp>
#include <libp2p/basic/readwriter.hpp> #include <libp2p/basic/readwriter.hpp>
#include <libp2p/peer/protocol.hpp> #include <libp2p/peer/protocol.hpp>

2
include/libp2p/security/error.hpp

@ -6,7 +6,7 @@
#ifndef LIBP2P_SECURITY_ERROR_HPP #ifndef LIBP2P_SECURITY_ERROR_HPP
#define LIBP2P_SECURITY_ERROR_HPP #define LIBP2P_SECURITY_ERROR_HPP
#include <outcome/outcome.hpp> #include <libp2p/outcome/outcome.hpp>
namespace libp2p::security { namespace libp2p::security {

2
include/libp2p/security/security_adaptor.hpp

@ -12,7 +12,7 @@
#include <libp2p/connection/raw_connection.hpp> #include <libp2p/connection/raw_connection.hpp>
#include <libp2p/connection/secure_connection.hpp> #include <libp2p/connection/secure_connection.hpp>
#include <libp2p/peer/peer_id.hpp> #include <libp2p/peer/peer_id.hpp>
#include <outcome/outcome.hpp> #include <libp2p/outcome/outcome.hpp>
namespace libp2p::security { namespace libp2p::security {

2
include/libp2p/transport/tcp/tcp_util.hpp

@ -12,7 +12,7 @@
#include <boost/asio.hpp> #include <boost/asio.hpp>
#include <boost/lexical_cast.hpp> #include <boost/lexical_cast.hpp>
#include <gsl/span> #include <gsl/span>
#include <outcome/outcome.hpp> #include <libp2p/outcome/outcome.hpp>
#include <libp2p/multi/multiaddress.hpp> #include <libp2p/multi/multiaddress.hpp>
namespace libp2p::transport::detail { namespace libp2p::transport::detail {

2
include/libp2p/transport/transport_adaptor.hpp

@ -17,7 +17,7 @@
#include <libp2p/multi/multiaddress.hpp> #include <libp2p/multi/multiaddress.hpp>
#include <libp2p/peer/peer_id.hpp> #include <libp2p/peer/peer_id.hpp>
#include <libp2p/transport/transport_listener.hpp> #include <libp2p/transport/transport_listener.hpp>
#include <outcome/outcome.hpp> // for outcome::result #include <libp2p/outcome/outcome.hpp> // for outcome::result
namespace libp2p::transport { namespace libp2p::transport {

2
include/libp2p/transport/upgrader.hpp

@ -11,7 +11,7 @@
#include <libp2p/connection/capable_connection.hpp> #include <libp2p/connection/capable_connection.hpp>
#include <libp2p/connection/raw_connection.hpp> #include <libp2p/connection/raw_connection.hpp>
#include <libp2p/connection/secure_connection.hpp> #include <libp2p/connection/secure_connection.hpp>
#include <outcome/outcome.hpp> #include <libp2p/outcome/outcome.hpp>
namespace libp2p::transport { namespace libp2p::transport {

2
src/CMakeLists.txt

@ -22,4 +22,4 @@ add_library(p2p
target_link_libraries(p2p INTERFACE target_link_libraries(p2p INTERFACE
p2p_default_network p2p_default_network
) )
libp2p_install(p2p)

10
src/basic/CMakeLists.txt

@ -3,21 +3,21 @@
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
# #
add_library(p2p_varint_reader libp2p_add_library(p2p_varint_reader
varint_reader.cpp varint_reader.cpp
) )
target_link_libraries(p2p_varint_reader target_link_libraries(p2p_varint_reader
p2p_uvarint p2p_uvarint
) )
add_library(p2p_message_read_writer_error libp2p_add_library(p2p_message_read_writer_error
message_read_writer_error.cpp message_read_writer_error.cpp
) )
target_link_libraries(p2p_message_read_writer_error target_link_libraries(p2p_message_read_writer_error
outcome Boost::boost
) )
add_library(p2p_message_read_writer libp2p_add_library(p2p_message_read_writer
message_read_writer.cpp message_read_writer.cpp
) )
target_link_libraries(p2p_message_read_writer target_link_libraries(p2p_message_read_writer
@ -25,7 +25,7 @@ target_link_libraries(p2p_message_read_writer
p2p_varint_reader p2p_varint_reader
) )
add_library(p2p_protobuf_message_read_writer libp2p_add_library(p2p_protobuf_message_read_writer
protobuf_message_read_writer.cpp protobuf_message_read_writer.cpp
) )
target_link_libraries(p2p_protobuf_message_read_writer target_link_libraries(p2p_protobuf_message_read_writer

5
src/common/CMakeLists.txt

@ -3,14 +3,13 @@
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
# #
add_library(p2p_hexutil libp2p_add_library(p2p_hexutil
hexutil.cpp hexutil.cpp
) )
target_link_libraries(p2p_hexutil target_link_libraries(p2p_hexutil
Boost::boost Boost::boost
outcome
) )
add_library(p2p_logger libp2p_add_library(p2p_logger
logger.cpp logger.cpp
) )

6
src/crypto/CMakeLists.txt

@ -12,14 +12,14 @@ add_subdirectory(protobuf)
add_subdirectory(random_generator) add_subdirectory(random_generator)
add_subdirectory(sha) add_subdirectory(sha)
add_library(p2p_crypto_error libp2p_add_library(p2p_crypto_error
error.cpp error.cpp
) )
target_link_libraries(p2p_crypto_error target_link_libraries(p2p_crypto_error
outcome Boost::boost
) )
add_library(p2p_crypto_key libp2p_add_library(p2p_crypto_key
key.cpp key.cpp
) )
target_link_libraries(p2p_crypto_key target_link_libraries(p2p_crypto_key

2
src/crypto/aes_provider/CMakeLists.txt

@ -3,7 +3,7 @@
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
# #
add_library(p2p_aes_provider libp2p_add_library(p2p_aes_provider
aes_provider_impl.cpp aes_provider_impl.cpp
) )

2
src/crypto/hmac_provider/CMakeLists.txt

@ -3,7 +3,7 @@
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
# #
add_library(p2p_hmac_provider libp2p_add_library(p2p_hmac_provider
hmac_provider_impl.cpp hmac_provider_impl.cpp
) )
target_link_libraries(p2p_hmac_provider target_link_libraries(p2p_hmac_provider

2
src/crypto/key_generator/CMakeLists.txt

@ -3,7 +3,7 @@
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
# #
add_library(p2p_key_generator libp2p_add_library(p2p_key_generator
key_generator_impl.cpp key_generator_impl.cpp
) )

2
src/crypto/key_marshaller/CMakeLists.txt

@ -3,7 +3,7 @@
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
# #
add_library(p2p_key_marshaller libp2p_add_library(p2p_key_marshaller
key_marshaller_impl.cpp key_marshaller_impl.cpp
) )
target_link_libraries(p2p_key_marshaller target_link_libraries(p2p_key_marshaller

2
src/crypto/key_validator/CMakeLists.txt

@ -3,7 +3,7 @@
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
# #
add_library(p2p_key_validator libp2p_add_library(p2p_key_validator
key_validator_impl.cpp key_validator_impl.cpp
) )
target_link_libraries(p2p_key_validator target_link_libraries(p2p_key_validator

2
src/crypto/random_generator/CMakeLists.txt

@ -3,7 +3,7 @@
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
# #
add_library(p2p_random_generator libp2p_add_library(p2p_random_generator
boost_generator.cpp boost_generator.cpp
) )

2
src/crypto/sha/CMakeLists.txt

@ -3,7 +3,7 @@
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
# #
add_library(p2p_sha libp2p_add_library(p2p_sha
sha256.cpp sha256.cpp
) )
target_link_libraries(p2p_sha target_link_libraries(p2p_sha

5
src/host/basic_host/CMakeLists.txt

@ -1,9 +1,10 @@
# Copyright Soramitsu Co., Ltd. All Rights Reserved. # Copyright Soramitsu Co., Ltd. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
add_library(p2p_basic_host libp2p_add_library(p2p_basic_host
basic_host.cpp basic_host.cpp
) )
target_link_libraries(p2p_basic_host target_link_libraries(p2p_basic_host
outcome Boost::boost
p2p_multiaddress
) )

13
src/multi/CMakeLists.txt

@ -6,30 +6,29 @@
add_subdirectory(converters) add_subdirectory(converters)
add_subdirectory(multibase_codec) add_subdirectory(multibase_codec)
add_library(p2p_uvarint libp2p_add_library(p2p_uvarint
uvarint.cpp uvarint.cpp
) )
target_link_libraries(p2p_uvarint target_link_libraries(p2p_uvarint
outcome Boost::boost
p2p_hexutil p2p_hexutil
) )
add_library(p2p_multihash libp2p_add_library(p2p_multihash
multihash.cpp multihash.cpp
) )
target_link_libraries(p2p_multihash target_link_libraries(p2p_multihash
p2p_hexutil p2p_hexutil
p2p_uvarint p2p_uvarint
Boost::boost Boost::boost
Microsoft.GSL::GSL
) )
add_library(p2p_multiaddress libp2p_add_library(p2p_multiaddress
multiaddress.cpp multiaddress.cpp
) )
target_link_libraries(p2p_multiaddress target_link_libraries(p2p_multiaddress
p2p_converter_utils p2p_converters
outcome Boost::boost
) )

19
src/multi/converters/CMakeLists.txt

@ -3,24 +3,9 @@
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
# #
add_library(p2p_converter_utils libp2p_add_library(p2p_converters
converter_utils.cpp converter_utils.cpp
)
target_link_libraries(p2p_converter_utils
p2p_conversion_error
p2p_uvarint
p2p_hexutil
p2p_converters
)
add_library(p2p_conversion_error
conversion_error.cpp conversion_error.cpp
)
target_link_libraries(p2p_conversion_error
outcome
)
add_library(p2p_converters
ip_v4_converter.cpp ip_v4_converter.cpp
ip_v6_converter.cpp ip_v6_converter.cpp
tcp_converter.cpp tcp_converter.cpp
@ -28,7 +13,7 @@ add_library(p2p_converters
ipfs_converter.cpp ipfs_converter.cpp
) )
target_link_libraries(p2p_converters target_link_libraries(p2p_converters
outcome Boost::boost
p2p_hexutil p2p_hexutil
p2p_uvarint p2p_uvarint
p2p_multibase_codec p2p_multibase_codec

2
src/multi/converters/converter_utils.cpp

@ -19,7 +19,7 @@
#include <libp2p/multi/multiaddress_protocol_list.hpp> #include <libp2p/multi/multiaddress_protocol_list.hpp>
#include <libp2p/multi/multibase_codec/multibase_codec_impl.hpp> #include <libp2p/multi/multibase_codec/multibase_codec_impl.hpp>
#include <libp2p/multi/uvarint.hpp> #include <libp2p/multi/uvarint.hpp>
#include <outcome/outcome.hpp> #include <libp2p/outcome/outcome.hpp>
using libp2p::common::hex_upper; using libp2p::common::hex_upper;
using libp2p::common::unhex; using libp2p::common::unhex;

2
src/multi/converters/ip_v4_converter.cpp

@ -11,7 +11,7 @@
#include <libp2p/common/hexutil.hpp> #include <libp2p/common/hexutil.hpp>
#include <libp2p/multi/converters/conversion_error.hpp> #include <libp2p/multi/converters/conversion_error.hpp>
#include <libp2p/multi/multiaddress_protocol_list.hpp> #include <libp2p/multi/multiaddress_protocol_list.hpp>
#include <outcome/outcome.hpp> #include <libp2p/outcome/outcome.hpp>
namespace libp2p::multi::converters { namespace libp2p::multi::converters {

2
src/multi/converters/ip_v6_converter.cpp

@ -11,7 +11,7 @@
#include <libp2p/common/hexutil.hpp> #include <libp2p/common/hexutil.hpp>
#include <libp2p/multi/converters/conversion_error.hpp> #include <libp2p/multi/converters/conversion_error.hpp>
#include <libp2p/multi/multiaddress_protocol_list.hpp> #include <libp2p/multi/multiaddress_protocol_list.hpp>
#include <outcome/outcome.hpp> #include <libp2p/outcome/outcome.hpp>
namespace libp2p::multi::converters { namespace libp2p::multi::converters {

2
src/multi/converters/ipfs_converter.cpp

@ -12,7 +12,7 @@
#include <libp2p/multi/converters/conversion_error.hpp> #include <libp2p/multi/converters/conversion_error.hpp>
#include <libp2p/multi/multibase_codec/multibase_codec_impl.hpp> #include <libp2p/multi/multibase_codec/multibase_codec_impl.hpp>
#include <libp2p/multi/uvarint.hpp> #include <libp2p/multi/uvarint.hpp>
#include <outcome/outcome.hpp> #include <libp2p/outcome/outcome.hpp>
using std::string_literals::operator""s; using std::string_literals::operator""s;

2
src/multi/converters/tcp_converter.cpp

@ -9,7 +9,7 @@
#include <libp2p/common/hexutil.hpp> #include <libp2p/common/hexutil.hpp>
#include <libp2p/multi/converters/conversion_error.hpp> #include <libp2p/multi/converters/conversion_error.hpp>
#include <outcome/outcome.hpp> #include <libp2p/outcome/outcome.hpp>
namespace libp2p::multi::converters { namespace libp2p::multi::converters {

2
src/multi/converters/udp_converter.cpp

@ -7,7 +7,7 @@
#include <libp2p/common/hexutil.hpp> #include <libp2p/common/hexutil.hpp>
#include <libp2p/multi/converters/conversion_error.hpp> #include <libp2p/multi/converters/conversion_error.hpp>
#include <outcome/outcome.hpp> #include <libp2p/outcome/outcome.hpp>
namespace libp2p::multi::converters { namespace libp2p::multi::converters {

2
src/multi/multibase_codec/CMakeLists.txt

@ -3,7 +3,7 @@
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
# #
add_library(p2p_multibase_codec libp2p_add_library(p2p_multibase_codec
multibase_codec_impl.cpp multibase_codec_impl.cpp
codecs/base16.cpp codecs/base16.cpp
codecs/base58.cpp codecs/base58.cpp

8
src/muxer/yamux/CMakeLists.txt

@ -3,20 +3,22 @@
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
# #
add_library(p2p_yamux libp2p_add_library(p2p_yamux
yamux.cpp yamux.cpp
) )
target_link_libraries(p2p_yamux target_link_libraries(p2p_yamux
p2p_yamuxed_connection p2p_yamuxed_connection
p2p_peer_id
) )
add_library(p2p_yamuxed_connection libp2p_add_library(p2p_yamuxed_connection
yamuxed_connection.cpp yamuxed_connection.cpp
yamux_frame.cpp yamux_frame.cpp
yamux_stream.cpp yamux_stream.cpp
) )
target_link_libraries(p2p_yamuxed_connection target_link_libraries(p2p_yamuxed_connection
outcome Boost::boost
p2p_logger p2p_logger
p2p_peer_id
) )

2
src/network/CMakeLists.txt

@ -5,7 +5,7 @@
add_subdirectory(impl) add_subdirectory(impl)
add_library(p2p_default_network libp2p_add_library(p2p_default_network
default_network.cpp default_network.cpp
) )
target_link_libraries(p2p_default_network target_link_libraries(p2p_default_network

19
src/network/impl/CMakeLists.txt

@ -3,15 +3,16 @@
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
# #
add_library(p2p_router libp2p_add_library(p2p_router
router_impl.cpp router_impl.cpp
) )
target_link_libraries(p2p_router target_link_libraries(p2p_router
outcome Boost::boost
p2p_peer_id
) )
add_library(p2p_listener_manager libp2p_add_library(p2p_listener_manager
listener_manager_impl.cpp listener_manager_impl.cpp
) )
target_link_libraries(p2p_listener_manager target_link_libraries(p2p_listener_manager
@ -21,7 +22,7 @@ target_link_libraries(p2p_listener_manager
) )
add_library(p2p_dialer libp2p_add_library(p2p_dialer
dialer_impl.cpp dialer_impl.cpp
) )
target_link_libraries(p2p_dialer target_link_libraries(p2p_dialer
@ -31,23 +32,23 @@ target_link_libraries(p2p_dialer
) )
add_library(p2p_network libp2p_add_library(p2p_network
network_impl.cpp network_impl.cpp
) )
target_link_libraries(p2p_network target_link_libraries(p2p_network
outcome Boost::boost
) )
add_library(p2p_transport_manager libp2p_add_library(p2p_transport_manager
transport_manager_impl.cpp transport_manager_impl.cpp
) )
target_link_libraries(p2p_transport_manager target_link_libraries(p2p_transport_manager
p2p_multiaddress p2p_multiaddress
) )
add_library(p2p_connection_manager libp2p_add_library(p2p_connection_manager
connection_manager_impl.cpp connection_manager_impl.cpp
) )
target_link_libraries(p2p_connection_manager target_link_libraries(p2p_connection_manager
outcome Boost::boost
) )

14
src/peer/CMakeLists.txt

@ -8,35 +8,35 @@ add_subdirectory(key_repository)
add_subdirectory(protocol_repository) add_subdirectory(protocol_repository)
add_subdirectory(impl) add_subdirectory(impl)
add_library(p2p_address_repository libp2p_add_library(p2p_address_repository
address_repository.cpp address_repository.cpp
) )
target_link_libraries(p2p_address_repository target_link_libraries(p2p_address_repository
Boost::boost Boost::boost
) )
add_library(p2p_peer_errors libp2p_add_library(p2p_peer_errors
errors.cpp errors.cpp
) )
target_link_libraries(p2p_peer_errors target_link_libraries(p2p_peer_errors
outcome Boost::boost
) )
add_library(p2p_peer_id libp2p_add_library(p2p_peer_id
peer_id.cpp peer_id.cpp
) )
target_link_libraries(p2p_peer_id target_link_libraries(p2p_peer_id
outcome Boost::boost
p2p_multihash p2p_multihash
p2p_multibase_codec p2p_multibase_codec
p2p_sha p2p_sha
) )
add_library(p2p_peer_address libp2p_add_library(p2p_peer_address
peer_address.cpp peer_address.cpp
) )
target_link_libraries(p2p_peer_address target_link_libraries(p2p_peer_address
outcome Boost::boost
p2p_multiaddress p2p_multiaddress
p2p_multihash p2p_multihash
p2p_multibase_codec p2p_multibase_codec

2
src/peer/address_repository/CMakeLists.txt

@ -1,7 +1,7 @@
# Copyright Soramitsu Co., Ltd. All Rights Reserved. # Copyright Soramitsu Co., Ltd. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
add_library(p2p_inmem_address_repository libp2p_add_library(p2p_inmem_address_repository
inmem_address_repository.cpp inmem_address_repository.cpp
) )
target_link_libraries(p2p_inmem_address_repository target_link_libraries(p2p_inmem_address_repository

4
src/peer/impl/CMakeLists.txt

@ -3,14 +3,14 @@
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
# #
add_library(p2p_identity_manager libp2p_add_library(p2p_identity_manager
identity_manager_impl.cpp identity_manager_impl.cpp
) )
target_link_libraries(p2p_identity_manager target_link_libraries(p2p_identity_manager
p2p_peer_id p2p_peer_id
) )
add_library(p2p_peer_repository libp2p_add_library(p2p_peer_repository
peer_repository_impl.cpp peer_repository_impl.cpp
) )
target_link_libraries(p2p_peer_repository target_link_libraries(p2p_peer_repository

2
src/peer/key_repository/CMakeLists.txt

@ -1,7 +1,7 @@
# Copyright Soramitsu Co., Ltd. All Rights Reserved. # Copyright Soramitsu Co., Ltd. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
add_library(p2p_inmem_key_repository libp2p_add_library(p2p_inmem_key_repository
inmem_key_repository.cpp inmem_key_repository.cpp
) )
target_link_libraries(p2p_inmem_key_repository target_link_libraries(p2p_inmem_key_repository

4
src/peer/protocol_repository/CMakeLists.txt

@ -1,11 +1,11 @@
# Copyright Soramitsu Co., Ltd. All Rights Reserved. # Copyright Soramitsu Co., Ltd. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
add_library(p2p_inmem_protocol_repository libp2p_add_library(p2p_inmem_protocol_repository
inmem_protocol_repository.cpp inmem_protocol_repository.cpp
) )
target_link_libraries(p2p_inmem_protocol_repository target_link_libraries(p2p_inmem_protocol_repository
outcome Boost::boost
p2p_peer_errors p2p_peer_errors
p2p_multihash p2p_multihash
p2p_peer_id p2p_peer_id

2
src/protocol/echo/CMakeLists.txt

@ -1,7 +1,7 @@
# Copyright Soramitsu Co., Ltd. All Rights Reserved. # Copyright Soramitsu Co., Ltd. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
add_library(p2p_protocol_echo libp2p_add_library(p2p_protocol_echo
echo.cpp echo.cpp
server_echo_session.cpp server_echo_session.cpp
client_echo_session.cpp client_echo_session.cpp

2
src/protocol/identify/CMakeLists.txt

@ -5,7 +5,7 @@
add_subdirectory(protobuf) add_subdirectory(protobuf)
add_library(p2p_identify libp2p_add_library(p2p_identify
identify.cpp identify.cpp
identify_msg_processor.cpp identify_msg_processor.cpp
observed_addresses.cpp observed_addresses.cpp

4
src/protocol/kademlia/impl/CMakeLists.txt

@ -1,7 +1,7 @@
# Copyright Soramitsu Co., Ltd. All Rights Reserved. # Copyright Soramitsu Co., Ltd. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
add_library(p2p_protocol_kademlia libp2p_add_library(p2p_protocol_kademlia
kad_impl.cpp kad_impl.cpp
) )
target_link_libraries(p2p_protocol_kademlia target_link_libraries(p2p_protocol_kademlia
@ -10,7 +10,7 @@ target_link_libraries(p2p_protocol_kademlia
) )
add_library(p2p_kad_routing_table libp2p_add_library(p2p_kad_routing_table
routing_table_impl.cpp routing_table_impl.cpp
) )
target_link_libraries(p2p_kad_routing_table target_link_libraries(p2p_kad_routing_table

2
src/protocol/ping/CMakeLists.txt

@ -1,7 +1,7 @@
# Copyright Soramitsu Co., Ltd. All Rights Reserved. # Copyright Soramitsu Co., Ltd. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
add_library(p2p_ping libp2p_add_library(p2p_ping
ping.cpp ping.cpp
ping_server_session.cpp ping_server_session.cpp
ping_client_session.cpp ping_client_session.cpp

2
src/protocol_muxer/multiselect/CMakeLists.txt

@ -3,7 +3,7 @@
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
# #
add_library(p2p_multiselect libp2p_add_library(p2p_multiselect
multiselect.cpp multiselect.cpp
message_manager.cpp message_manager.cpp
message_reader.cpp message_reader.cpp

4
src/security/CMakeLists.txt

@ -5,9 +5,9 @@
add_subdirectory(plaintext) add_subdirectory(plaintext)
add_library(p2p_security_error libp2p_add_library(p2p_security_error
error.cpp error.cpp
) )
target_link_libraries(p2p_security_error target_link_libraries(p2p_security_error
outcome Boost::boost
) )

8
src/security/plaintext/CMakeLists.txt

@ -5,23 +5,23 @@
add_subdirectory(protobuf) add_subdirectory(protobuf)
add_library(p2p_plaintext libp2p_add_library(p2p_plaintext
plaintext.cpp plaintext.cpp
plaintext_connection.cpp plaintext_connection.cpp
plaintext_session.cpp plaintext_session.cpp
) )
target_link_libraries(p2p_plaintext target_link_libraries(p2p_plaintext
outcome Boost::boost
p2p_security_error p2p_security_error
p2p_plaintext_exchange_message_marshaller p2p_plaintext_exchange_message_marshaller
p2p_crypto_error p2p_crypto_error
) )
add_library(p2p_plaintext_exchange_message_marshaller libp2p_add_library(p2p_plaintext_exchange_message_marshaller
exchange_message_marshaller_impl.cpp exchange_message_marshaller_impl.cpp
) )
target_link_libraries(p2p_plaintext_exchange_message_marshaller target_link_libraries(p2p_plaintext_exchange_message_marshaller
outcome Boost::boost
p2p_plaintext_protobuf p2p_plaintext_protobuf
p2p_key_marshaller p2p_key_marshaller
) )

10
src/transport/impl/CMakeLists.txt

@ -3,7 +3,7 @@
add_library(p2p_transport_parser libp2p_add_library(p2p_transport_parser
multiaddress_parser.cpp multiaddress_parser.cpp
) )
target_link_libraries(p2p_transport_parser target_link_libraries(p2p_transport_parser
@ -11,18 +11,18 @@ target_link_libraries(p2p_transport_parser
p2p_multiaddress p2p_multiaddress
) )
add_library(p2p_upgrader libp2p_add_library(p2p_upgrader
upgrader_impl.cpp upgrader_impl.cpp
) )
target_link_libraries(p2p_upgrader target_link_libraries(p2p_upgrader
outcome Boost::boost
) )
add_library(p2p_upgrader_session libp2p_add_library(p2p_upgrader_session
upgrader_session.cpp upgrader_session.cpp
) )
target_link_libraries(p2p_upgrader_session target_link_libraries(p2p_upgrader_session
outcome Boost::boost
p2p_upgrader p2p_upgrader
) )

6
src/transport/tcp/CMakeLists.txt

@ -1,20 +1,20 @@
# Copyright Soramitsu Co., Ltd. All Rights Reserved. # Copyright Soramitsu Co., Ltd. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
add_library(p2p_tcp_connection tcp_connection.cpp) libp2p_add_library(p2p_tcp_connection tcp_connection.cpp)
target_link_libraries(p2p_tcp_connection target_link_libraries(p2p_tcp_connection
Boost::boost Boost::boost
p2p_multiaddress p2p_multiaddress
p2p_upgrader_session p2p_upgrader_session
) )
add_library(p2p_tcp_listener tcp_listener.cpp) libp2p_add_library(p2p_tcp_listener tcp_listener.cpp)
target_link_libraries(p2p_tcp_listener target_link_libraries(p2p_tcp_listener
p2p_tcp_connection p2p_tcp_connection
p2p_upgrader_session p2p_upgrader_session
) )
add_library(p2p_tcp tcp_transport.cpp) libp2p_add_library(p2p_tcp tcp_transport.cpp)
target_link_libraries(p2p_tcp target_link_libraries(p2p_tcp
p2p_tcp_connection p2p_tcp_connection
p2p_tcp_listener p2p_tcp_listener

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save