diff --git a/README.md b/README.md index 42c38b1f..d98e937b 100644 --- a/README.md +++ b/README.md @@ -143,45 +143,53 @@ TODO ### On Windows: 1. Install [msys2](http://msys2.github.io/), follow the instructions on that page on how to update packages to the latest versions -2. Install monero dependencies as described in [monero documentation](https://github.com/monero-project/monero) -3. Install git: +2. Install monero dependencies as described in [monero documentation](https://github.com/monero-project/monero) into msys2 environment. + **As we only build application for x86, install only dependencies for x86 architecture (i686 in package name)** + +3. Install git into msys2 environment: ``` pacman -S git ``` -4. Install Qt5: - - if you need to build x86 application, install: - - ``` - pacman -S mingw-w64-i686-qt5 - ``` - - if you need to build x64 application, install: +4. Install Qt5 from [official site](https://www.qt.io/download-open-source/). + - download unified installer, run and select following options: + - Qt > Qt 5.7 > MinGW 5.3.0 32 bit + - Tools > MinGW 5.3.0 + - continue with installation - ``` - pacman -S mingw-w64-x86_64-qt5 - ``` -5. Open ```mingw``` shell. MSYS2 will install start menu items for both mingw32 and mingw64 environments, so - you need to open appropriate one: - ```%MSYS_ROOT%\msys2_shell.cmd -mingw32``` for x86 targed - or - ```%MSYS_ROOT%\msys2_shell.cmd -mingw64``` for x64 targed +5. Open ```mingw``` shell: + ```%MSYS_ROOT%\msys2_shell.cmd -mingw32``` + Where ```%MSYS_ROOT%``` will be ```c:\msys32``` if your host OS is x86-based or ```c:\msys64``` if your host OS is x64-based -6. Clone git repository: + +6. Clone repository: ``` git clone https://github.com/monero-project/monero-core.git ``` -7. Build the project: +7. Build libwallet: ``` cd monero-core - ./build.sh + ./get_libwallet_api.sh ``` -8. Take result binary and dependencies in ```./build/release/bin``` + close ```mingw``` shell after it done + +8. Build application: + + - open ```Qt environment``` shell (Qt 5.7 for Desktop (MinGW 5.3.0 32 bit) is shortcut name) + - navigate to the project dir and build the app: + ``` + cd %MSYS_ROOT%\%USERNAME%\monero-core + mkdir build + cd build + qmake ..\ -r "CONFIG+=release" + mingw32-make release + mingw32-make deploy + ``` + - grab result binary and dependencies in ```.\release\bin``` + + - **important: if you testing application within VirtualBox virtual machine, make sure 3D acceleration is enabled - in machine's settings: - Machine > Settings > Display > [v] Enable 3D Acceleration** - diff --git a/monero-core.pro b/monero-core.pro index 3121f109..8c446290 100644 --- a/monero-core.pro +++ b/monero-core.pro @@ -54,8 +54,31 @@ LIBS += -L$$WALLET_ROOT/lib \ -lwallet_merged \ -lunbound + +# currently we only support x86 build as qt.io only provides prebuilt qt for x86 mingw + win32 { - #QMAKE_LFLAGS += -static + + contains(QMAKE_HOST.arch, x86_64) { + message("Host is 64bit") + MSYS_PATH=c:/msys64/mingw32 + } else { + message("Host is 32bit") + MSYS_PATH=c:/msys32/mingw32 + } + + !contains(QMAKE_TARGET.arch, x86_64) { + message("Target is 32bit") + ## Windows x86 (32bit) specific build here + ## there's 2Mb stack in libwallet allocated internally, so we set stack=4Mb + ## this fixes app crash for x86 Windows build + QMAKE_LFLAGS += -Wl,--stack,4194304 + } else { + message("Target is 64bit") + } + + LIBS+=-L$$MSYS_PATH/lib + LIBS+= \ -Wl,-Bstatic \ -lboost_serialization-mt \ @@ -75,16 +98,6 @@ win32 { -lgdi32 - !contains(QMAKE_TARGET.arch, x86_64) { - message("x86 build") - ## Windows x86 (32bit) specific build here - ## there's 2Mb stack in libwallet allocated internally - ## this fixes app crash for x86 Windows build - QMAKE_LFLAGS += -Wl,--stack,4194304 - } else { - message("x64 build") - } - } @@ -208,7 +221,6 @@ macx { win32 { deploy.commands += windeployqt $$sprintf("%1/%2/%3.exe", $$OUT_PWD, $$DESTDIR, $$TARGET) -release -qmldir=$$PWD - deploy.commands += $$escape_expand(\n\t) $$PWD/windeploy_helper.sh $$DESTDIR }