|
|
| Line 1: |
Line 1: |
| h1. Building Qt/Android on Windows
| |
|
| |
|
| Tested last time on branch 5.4 2015-01-22
| |
|
| |
| Note, it is not currently possible to use Microsoft's compilers to build the Windows host tools for Qt Android.
| |
|
| |
| == ——————— Configuration ——————— ==
| |
|
| |
| * '''Install the latest Perl:'''<br />http://strawberryperl.com/<br />Select Destination folder (we'll call this <PERL_ROOT&gt;, and refer similarly to other install locations).
| |
|
| |
| * '''Install the latest mingwbuilds MSYS and external binaries (for git):'''<br />http://sourceforge.net/projects/mingwbuilds/files/external-binary-packages/msys+7za+wget+svn+git+mercurial+cvs-rev13.7z/download<br />Extract this to <MINGW_BUILDS_ROOT&gt; (I use C:-buildsso I end up with C:-builds\msys
| |
|
| |
| * '''Install the latest MinGW-w64 from mingwbuilds:'''<br />http://sourceforge.net/projects/mingwbuilds/files/host-windows/releases/4.8.1/32-bit/threads-win32/dwarf/x32-4.8.1-release-win32-dwarf-rev1.7z/download<br />extract to <MINGW_BUILDS_ROOT&gt; and add <MINGW_BUILDS_ROOT&gt;32\bin to the '''front''' of your PATH.
| |
|
| |
| * '''Install the latest JDK 7:'''<br />http://www.oracle.com/technetwork/java/javase/downloads/index.html<br />Add <JDK_ROOT&gt;to PATH.
| |
|
| |
| * '''Install Android NDK:'''<br />https://developer.android.com/tools/sdk/ndk/index.html<br />Extract to <ANDROID_NDK_PATH&gt;<br />If you have ndk9 installed update it to latest version cause it doesn't work any more.
| |
|
| |
| * '''Install the latest Android SDK (tools only):'''<br />http://developer.android.com/sdk/index.html<br />Run the Android SDK Manager and install the latest version of "SDK Platform&quot;, "Google APIs&quot; and "build-tools&quot; in <ANDROID_SDK_PATH&gt;
| |
|
| |
| * '''Open cmd.exe window and perform some checks:'''<br />Ensure "where gcc.exe&quot; lists <MINGW_ROOT&gt;.exe first (before <PERL_ROOT&gt;.exe)<br />Ensure "where mingw32-make.exe&quot; lists <MINGW_ROOT&gt;32-make.exe first.<br />Ensure "where perl.exe&quot; lists <PERL_ROOT&gt;.exe first.<br />Ensure "where javac.exe&quot; lists <JDK_ROOT&gt;first.
| |
|
| |
| * '''Add some environment variables:'''<br />set "ANDROID_API_VERSION=android-21&quot;<br />set "ANDROID_SDK_ROOT=<ANDROID_SDK_PATH&gt;"<br />set "ANDROID_TARGET_ARCH=armeabi-v7a&quot;<br />set "ANDROID_BUILD_TOOLS_REVISION=21.1.2&quot;<br />set "ANDROID_NDK_PATH=<ANDROID_NDK_PATH&gt;"<br />set "ANDROID_TOOLCHAIN_VERSION=4.9&quot;<br />set "ANDROID_NDK_HOST=windows-x86_64&quot;<br />or<br />set "ANDROID_NDK_HOST=windows&quot;<br />.. depending on which NDK you downloaded.
| |
|
| |
| == ——————— Cloning ——————— ==
| |
|
| |
| * '''Make the root folder for the Qt/Android build:'''<br />Make sure there are no spaces in this path and that it doesn't contain too many characters.<br />I went for "C:"<br /><code>mkdir C:cd C:</code>
| |
|
| |
| * '''Follow step 4 at http://wiki.qt.io/Qt5ForAndroidBuilding'''
| |
|
| |
| == ——————— Build steps ——————— ==
| |
|
| |
| <code>configure.bat -developer-build -platform win32-g++ -opengl es2 -xplatform android-g++ -android-ndk ANDROID_NDK_PATH -android-sdk ANDROID_SDK_ROOT -opensource -confirm-license -nomake tests -nomake examples<br />mingw32-make.exe -j&lt;N&gt;</code>
| |
|
| |
| ..where <N&gt; is the number of parallel jobs your system can optimally exploit. If you have trouble, remove the <s>j&lt;N&gt;, and try again.
| |
| <br />* '''Follow steps 8..11 at http://wiki.qt.io/Qt5ForAndroidBuilding (replacing make with mingw32-make.exe)'''
| |
| <br />h2. ——————— Finally ———————
| |
| <br />You can also build Qt/Android from the MSYS shell</s> the one from mingw-builds that you already downloaded - following much the same procedure and using exactly the same software. This is currently left as an exercise for the reader.
| |