diff --git a/WalletManager.cpp b/WalletManager.cpp index 4a2f0c8f..cb0ffbac 100644 --- a/WalletManager.cpp +++ b/WalletManager.cpp @@ -1,5 +1,6 @@ #include "WalletManager.h" #include "Wallet.h" +#include "wallet/wallet2_api.h" #include #include #include @@ -17,6 +18,8 @@ WalletManager *WalletManager::instance() if (!m_instance) { m_instance = new WalletManager; } + // Checking linkage (doesn't work, TODO: have every dependencies linked statically into libwallet) + Bitmonero::WalletManager * wallet_manager_impl = Bitmonero::WalletManagerFactory::getWalletManager(); return m_instance; } diff --git a/get_libwallet_api.sh b/get_libwallet_api.sh new file mode 100755 index 00000000..9e2f65ce --- /dev/null +++ b/get_libwallet_api.sh @@ -0,0 +1,39 @@ +#!/bin/bash + + +BITMONERO_URL=https://github.com/mbg033/bitmonero +CPU_CORE_COUNT=$(grep -c ^processor /proc/cpuinfo) +pushd $(pwd) +ROOT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" + + +INSTALL_DIR=$ROOT_DIR/wallet +BITMONERO_DIR=$ROOT_DIR/bitmonero + + +if [ ! -d $BITMONERO_DIR ]; then + git clone --depth=1 $BITMONERO_URL $BITMONERO_DIR +fi + +rm -fr $BITMONERO_DIR/build +mkdir -p $BITMONERO_DIR/build/release +pushd $BITMONERO_DIR/build/release + +cmake -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX="$BITMONERO_DIR" ../.. + +pushd $BITMONERO_DIR/build/release/src/wallet +make -j$CPU_CORE_COUNT +make install -j$CPU_CORE_COUNT +popd +popd + + + + + + + + + + + diff --git a/monero-core.pro b/monero-core.pro index 1f4d97d4..8574205f 100644 --- a/monero-core.pro +++ b/monero-core.pro @@ -2,8 +2,14 @@ TEMPLATE = app QT += qml quick widgets +WALLET_ROOT=$$PWD/bitmonero + CONFIG += c++11 +INCLUDEPATH += $$WALLET_ROOT/include + +message($$INCLUDEPATH) + HEADERS += \ filter.h \ clipboardAdapter.h \ @@ -26,6 +32,8 @@ SOURCES = *.qml \ wizard/*.qml } +LIBS += -L$$WALLET_ROOT/lib -lwallet + # translations files; TRANSLATIONS = monero-core_en.ts \ # English (could be untranslated) monero-core_de.ts # Deutsch @@ -71,9 +79,3 @@ OTHER_FILES += \ DISTFILES += \ notes.txt - - - - - -