Skip to content

Commit

Permalink
build, qt: Fix Windows cross-compiling with Qt 5.15
Browse files Browse the repository at this point in the history
  • Loading branch information
barton2526 committed Apr 18, 2022
1 parent 3523320 commit ca96c72
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
4 changes: 1 addition & 3 deletions cd/05_before_script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@ fi
if [ -n "$XCODE_VERSION" ] && [ -f "$OSX_SDK_PATH" ]; then
DOCKER_EXEC tar -C "${DEPENDS_DIR}/SDKs" -xf "$OSX_SDK_PATH"
fi
if [[ $HOST = *-mingw32 ]]; then
DOCKER_EXEC update-alternatives --set $HOST-g++ \$\(which $HOST-g++-posix\)
fi

if [ -z "$NO_DEPENDS" ]; then
if [[ $DOCKER_NAME_TAG == centos* ]]; then
# CentOS has problems building the depends if the config shell is not explicitly set
Expand Down
1 change: 1 addition & 0 deletions depends/packages/qt.mk
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ $(package)_config_opts_mingw32 += -no-dbus
$(package)_config_opts_mingw32 += -no-freetype
$(package)_config_opts_mingw32 += -xplatform win32-g++
$(package)_config_opts_mingw32 += "QMAKE_CFLAGS = '$($(package)_cflags) $($(package)_cppflags)'"
$(package)_config_opts_mingw32 += "QMAKE_CXX = '$($(package)_cxx)'"
$(package)_config_opts_mingw32 += "QMAKE_CXXFLAGS = '$($(package)_cflags) $($(package)_cppflags)'"
$(package)_config_opts_mingw32 += "QMAKE_LFLAGS = '$($(package)_ldflags)'"
$(package)_config_opts_mingw32 += -device-option CROSS_COMPILE="$(host)-"
Expand Down
11 changes: 10 additions & 1 deletion doc/build-windows.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,17 @@ Acquire the source in the usual way:
## Building for 64-bit Windows

The first step is to install the mingw-w64 cross-compilation tool chain:
- on modern systems (Ubuntu 21.04 Hirsute Hippo or newer, Debian 11 Bullseye or newer):

sudo apt install g++-mingw-w64-x86-64
```sh
sudo apt install g++-mingw-w64-x86-64-posix
```

- on older systems:

```sh
sudo apt install g++-mingw-w64-x86-64
```

Once the toolchain is installed the build steps are common:

Expand Down

0 comments on commit ca96c72

Please sign in to comment.