From 4abf25f3c901016803515771cc19997d9a95bacb Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Wed, 29 Nov 2017 22:53:58 +0000 Subject: cryptonote_core does not depend on p2p anymore As a followon side effect, this makes a lot of inline code included only in particular cpp files (and instanciated when necessary. --- src/rpc/CMakeLists.txt | 3 ++- src/rpc/core_rpc_server.cpp | 2 ++ src/rpc/instanciations.cpp | 37 +++++++++++++++++++++++++++++++++++++ 3 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 src/rpc/instanciations.cpp (limited to 'src/rpc') diff --git a/src/rpc/CMakeLists.txt b/src/rpc/CMakeLists.txt index 23bb6aaae..652a03f44 100644 --- a/src/rpc/CMakeLists.txt +++ b/src/rpc/CMakeLists.txt @@ -28,7 +28,8 @@ set(rpc_sources core_rpc_server.cpp - rpc_args.cpp) + rpc_args.cpp + instanciations) set(daemon_messages_sources message.cpp diff --git a/src/rpc/core_rpc_server.cpp b/src/rpc/core_rpc_server.cpp index c2206c89a..f054b3ce0 100644 --- a/src/rpc/core_rpc_server.cpp +++ b/src/rpc/core_rpc_server.cpp @@ -44,6 +44,8 @@ using namespace epee; #include "crypto/hash.h" #include "rpc/rpc_args.h" #include "core_rpc_server_error_codes.h" +#include "p2p/net_node.h" +#include "version.h" #undef MONERO_DEFAULT_LOG_CATEGORY #define MONERO_DEFAULT_LOG_CATEGORY "daemon.rpc" diff --git a/src/rpc/instanciations.cpp b/src/rpc/instanciations.cpp new file mode 100644 index 000000000..ac521247e --- /dev/null +++ b/src/rpc/instanciations.cpp @@ -0,0 +1,37 @@ +// Copyright (c) 2017, The Monero Project +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, are +// permitted provided that the following conditions are met: +// +// 1. Redistributions of source code must retain the above copyright notice, this list of +// conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright notice, this list +// of conditions and the following disclaimer in the documentation and/or other +// materials provided with the distribution. +// +// 3. Neither the name of the copyright holder nor the names of its contributors may be +// used to endorse or promote products derived from this software without specific +// prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL +// THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF +// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers + +#include "p2p/net_node.h" +#include "p2p/net_node.inl" +#include "cryptonote_protocol/cryptonote_protocol_handler.h" +#include "cryptonote_protocol/cryptonote_protocol_handler.inl" + +namespace nodetool { template class node_server>; } +namespace cryptonote { template class t_cryptonote_protocol_handler; } -- cgit v1.2.3 From 43f5269f842cbdc585226eea20e48d19253f61e7 Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Wed, 29 Nov 2017 19:31:38 +0000 Subject: Wallets now do not depend on the daemon rpc lib The shared RPC code is now moved off into a separate lib --- src/rpc/CMakeLists.txt | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) (limited to 'src/rpc') diff --git a/src/rpc/CMakeLists.txt b/src/rpc/CMakeLists.txt index 652a03f44..748c6b8c1 100644 --- a/src/rpc/CMakeLists.txt +++ b/src/rpc/CMakeLists.txt @@ -26,9 +26,11 @@ # STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF # THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +set(rpc_base_sources + rpc_args.cpp) + set(rpc_sources core_rpc_server.cpp - rpc_args.cpp instanciations) set(daemon_messages_sources @@ -40,9 +42,11 @@ set(daemon_rpc_server_sources zmq_server.cpp) -set(rpc_headers +set(rpc_base_headers rpc_args.h) +set(rpc_headers) + set(daemon_rpc_server_headers) @@ -70,6 +74,11 @@ monero_private_headers(daemon_rpc_server ${daemon_rpc_server_private_headers}) +monero_add_library(rpc_base + ${rpc_base_sources} + ${rpc_base_headers} + ${rpc_base_private_headers}) + monero_add_library(rpc ${rpc_sources} ${rpc_headers} @@ -86,8 +95,18 @@ monero_add_library(daemon_rpc_server ${daemon_rpc_server_private_headers}) +target_link_libraries(rpc_base + PUBLIC + common + epee + ${Boost_REGEX_LIBRARY} + ${Boost_THREAD_LIBRARY} + PRIVATE + ${EXTRA_LIBRARIES}) + target_link_libraries(rpc PUBLIC + rpc_base common cryptonote_core cryptonote_protocol -- cgit v1.2.3