comparison qt5-cross-build.txt @ 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
children 30babce5c4be
comparison
equal deleted inserted replaced
26:55674cf632fb 27:0ade5c3e424c
1 # In Debian 9
2 apt-get install gcc-mingw-w64 g++-mingw-w64
3
4
5 # Clone Qt5 base git repo:
6 git clone https://code.qt.io/qt/qt5.git qt5-src
7 cd qt5-src/
8
9 # Checkout desired version
10 git checkout 5.8
11
12 # Initialize subrepos, we need just qtbase
13 ./init-repository -f --module-subset=qtbase
14 git checkout v5.8.0
15 git submodule update
16
17 # Configure for cross-compilation
18 ./configure -release -opensource -nomake examples -nomake tests -xplatform win32-g++ -device-option CROSS_COMPILE=i686-w64-mingw32- -opengl desktop
19
20 # Qt5.8 requires this Windows 10 -specific header file
21 wget https://raw.githubusercontent.com/tpn/winsdk-10/master/Include/10.0.10240.0/um/UIViewSettingsInterop.h
22 -O /usr/i686-w64-mingw32/include/
23
24 # Build it
25 make -j8
26
27
28 # To cross-compile using qmake
29 /misc/packages/qt5-src/qtbase/bin/qmake
30 make
31
32
33 # The compiled exe requires DLL libraries ( Qt5Core.dll Qt5Gui.dll Qt5Widgets.dll
34 # ) etc. which can be found from the QT5 cross build directory. Copy them
35 # into your application (executable) directory.
36 /misc/packages/qt5-src/qtbase/bin/
37
38
39 # And plugins, usually platforms/qwindows.dll and whatever you need,
40 # but it depends on your application. You will have to create the
41 # same subdirectories under your target application directory.
42
43 mkdir -p $TGTDIR/platforms
44 cp /misc/packages/qt5-src/qtbase/plugins/platforms/qwindows.dll $TGTDIR/platforms/
45
46
47 # Also libgcc and libstdc++ DLLs are needed, found from
48 /usr/lib/gcc/i686-w64-mingw32/6.3-win32/
49
50 # or so ..