Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions cd/05_before_script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# Copyright (c) 2018-2020 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
# file COPYING or https://www.opensource.org/licenses/mit-license.php.

export LC_ALL=C.UTF-8

Expand All @@ -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
4 changes: 1 addition & 3 deletions ci/test/05_before_script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,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
4 changes: 4 additions & 0 deletions depends/hosts/mingw32.mk
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
ifneq ($(shell which $(host)-g++-posix),)
mingw32_CXX := $(host)-g++-posix
endif

mingw32_CFLAGS=-pipe
mingw32_CXXFLAGS=$(mingw32_CFLAGS)

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
22 changes: 6 additions & 16 deletions doc/build-windows.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,26 +46,16 @@ 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

Next, set the default `mingw32 g++` compiler option to POSIX:

```
sudo update-alternatives --config x86_64-w64-mingw32-g++
```sh
sudo apt install g++-mingw-w64-x86-64-posix
```

After running the above command, you should see output similar to that below.
Choose the option that ends with `posix`.
- on older systems:

```
There are 2 choices for the alternative x86_64-w64-mingw32-g++ (providing /usr/bin/x86_64-w64-mingw32-g++).
Selection Path Priority Status
------------------------------------------------------------
0 /usr/bin/x86_64-w64-mingw32-g++-win32 60 auto mode
* 1 /usr/bin/x86_64-w64-mingw32-g++-posix 30 manual mode
2 /usr/bin/x86_64-w64-mingw32-g++-win32 60 manual mode
Press <enter> to keep the current choice[*], or type selection number:
```sh
sudo apt install g++-mingw-w64-x86-64
```

Once the toolchain is installed the build steps are common:
Expand Down