changeset 27:0ade5c3e424c

Some loose instructions for cross-building for Windows on Debian 9.
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 03 Apr 2017 14:32:43 +0300
parents 55674cf632fb
children b749685958d7
files qt5-cross-build.txt
diffstat 1 files changed, 50 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/qt5-cross-build.txt	Mon Apr 03 14:32:43 2017 +0300
@@ -0,0 +1,50 @@
+# In Debian 9
+apt-get install gcc-mingw-w64 g++-mingw-w64
+
+
+# Clone Qt5 base git repo:
+git clone https://code.qt.io/qt/qt5.git qt5-src
+cd qt5-src/
+
+# Checkout desired version
+git checkout 5.8
+
+# Initialize subrepos, we need just qtbase
+./init-repository -f --module-subset=qtbase
+git checkout v5.8.0
+git submodule update
+
+# Configure for cross-compilation
+./configure -release -opensource -nomake examples -nomake tests -xplatform win32-g++ -device-option CROSS_COMPILE=i686-w64-mingw32- -opengl desktop
+
+# Qt5.8 requires this Windows 10 -specific header file
+wget https://raw.githubusercontent.com/tpn/winsdk-10/master/Include/10.0.10240.0/um/UIViewSettingsInterop.h
+	-O /usr/i686-w64-mingw32/include/
+
+# Build it
+make -j8
+
+
+# To cross-compile using qmake
+/misc/packages/qt5-src/qtbase/bin/qmake
+make
+
+
+# The compiled exe requires DLL libraries ( Qt5Core.dll Qt5Gui.dll Qt5Widgets.dll
+# ) etc. which can be found from the QT5 cross build directory. Copy them
+# into your application (executable) directory.
+/misc/packages/qt5-src/qtbase/bin/
+
+
+# And plugins, usually platforms/qwindows.dll and whatever you need,
+# but it depends on your application. You will have to create the
+# same subdirectories under your target application directory.
+
+mkdir -p $TGTDIR/platforms
+cp /misc/packages/qt5-src/qtbase/plugins/platforms/qwindows.dll $TGTDIR/platforms/
+
+
+# Also libgcc and libstdc++ DLLs are needed, found from
+/usr/lib/gcc/i686-w64-mingw32/6.3-win32/
+
+# or so ..