libwallet_api cmake: conditionally creating libwallet_merged2 only for

STATIC build
This commit is contained in:
Ilya Kitaev 2016-07-13 15:26:31 +03:00
parent 10c06ddac7
commit 193d251360
2 changed files with 17 additions and 9 deletions

View file

@ -76,16 +76,25 @@ target_link_libraries(wallet
${EXTRA_LIBRARIES}) ${EXTRA_LIBRARIES})
# set(libs_to_merge wallet cryptonote_core mnemonics common crypto ${UNBOUND_LIBRARY} ) # in case of static build, randon.c.obj from UNBOUND_LIBARY conflicts with the same file from 'crypto'
set(libs_to_merge wallet cryptonote_core mnemonics common crypto) # and in case of dynamic build, merge_static_libs called with ${UNBOUND_LIBRARY} will fail
#MERGE_STATIC_LIBS(wallet_merged wallet_merged "${libs_to_merge}") if (STATIC)
merge_static_libs(wallet_merged "${libs_to_merge}") set(libs_to_merge wallet cryptonote_core mnemonics common crypto)
# hack - repack libunbound into another static lib - there's conflicting object file "random.c.obj"
# hack - repack libunbound into another static lib - there's conflicting object file "random.c.obj" merge_static_libs(wallet_merged "${libs_to_merge}")
merge_static_libs(wallet_merged2 "${UNBOUND_LIBRARY}") merge_static_libs(wallet_merged2 "${UNBOUND_LIBRARY}")
install(TARGETS wallet_merged wallet_merged2
install(TARGETS wallet_merged wallet_merged2
ARCHIVE DESTINATION lib) ARCHIVE DESTINATION lib)
else (STATIC)
set(libs_to_merge wallet cryptonote_core mnemonics common crypto ${UNBOUND_LIBRARY} )
merge_static_libs(wallet_merged "${libs_to_merge}")
install(TARGETS wallet_merged
ARCHIVE DESTINATION lib)
endif (STATIC)
#MERGE_STATIC_LIBS(wallet_merged wallet_merged "${libs_to_merge}")
install(FILES ${wallet_api_headers} install(FILES ${wallet_api_headers}
DESTINATION include/wallet) DESTINATION include/wallet)

View file

@ -371,8 +371,7 @@ bool WalletImpl::init(const std::string &daemon_address, uint64_t upper_transact
if (Utils::isAddressLocal(daemon_address)) { if (Utils::isAddressLocal(daemon_address)) {
this->setTrustedDaemon(true); this->setTrustedDaemon(true);
} }
startRefresh(); refresh();
} catch (const std::exception &e) { } catch (const std::exception &e) {
LOG_ERROR("Error initializing wallet: " << e.what()); LOG_ERROR("Error initializing wallet: " << e.what());
m_status = Status_Error; m_status = Status_Error;