Add cmake command line option SUPPORT_MULTIPLE_SONS

This commit is contained in:
Srdjan Obucina 2020-02-11 16:56:05 +01:00
parent 0d14b481a4
commit 75626254fa
2 changed files with 11 additions and 0 deletions

View file

@ -7,6 +7,13 @@ add_library( peerplays_sidechain
sidechain_net_handler_bitcoin.cpp
)
if (SUPPORT_MULTIPLE_SONS)
message ("Multiple SONs per software instance are supported")
target_compile_definitions(peerplays_sidechain PRIVATE SUPPORT_MULTIPLE_SONS)
endif()
unset(SUPPORT_MULTIPLE_SONS)
unset(SUPPORT_MULTIPLE_SONS CACHE)
target_link_libraries( peerplays_sidechain graphene_chain graphene_app fc zmq )
target_include_directories( peerplays_sidechain
PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include" )

View file

@ -119,6 +119,10 @@ void peerplays_sidechain_plugin_impl::plugin_initialize(const boost::program_opt
boost::insert(_sons, fc::json::from_string(options.at("son-ids").as<string>()).as<vector<chain::son_id_type>>( 5 ));
config_ready_son = config_ready_son && !_sons.empty();
#ifndef SUPPORT_MULTIPLE_SONS
FC_ASSERT( _sons.size() == 1, "Multiple SONs not supported" );
#endif
if( options.count("peerplays-private-key") )
{
const std::vector<std::string> key_id_to_wif_pair_strings = options["peerplays-private-key"].as<std::vector<std::string>>();