#36029 cmake: Detect and log MinGW-w64 version when cross-compiling for Windows
https://github.com/bitcoin/bitcoin/pull/36029 · · +36/-0 in 2 files, 1 commits · labels: Windows, Build system
Goal
- Log the MinGW-w64 version during Windows cross-compilation
- Makes diagnosing toolchain-specific build issues easier for developers
This pull request adds CMake logic to detect and display the MinGW-w64 toolchain version during cross-compilation for Windows. It inspects `_mingw_mac.h` within the compiler's implicit include directories and appends the detected version string to the configure status output.
Problem: Windows cross-compilation behavior varies depending on the specific MinGW-w64 version used, which can be hard to determine when the toolchain is not managed by a distribution package manager.
Category: Build and CI (#48 of 55)
P4 · cleanup
- P4 because it only adds diagnostic configure logging
- Provides minor debugging convenience without fixing bugs or altering build behavior
P4 because this is diagnostic logging in CMake rather than a bug fix or functional build system change. As noted in the description, it merely 'simplifies debugging when issues ... arise' by logging the toolchain version.
Membership: Touches CMakeLists.txt and adds a CMake module under cmake/module/ for Windows cross-compilation detection.
Factors: security/stability 0, bug 0, performance 0, user value 1, leverage 0
Reviewability: Ready
- Ready for review
- Small and self-contained with no blockers
The patch is small, self-contained, and has no open reviewer requests or merge blockers.
Author status: silent since submission on 2026-08-19
Agreement: Strong
- Uncontroversial diagnostic enhancement
- Verified by cross-compiling on Arch Linux and checking output (ViniciusCestarii)
Tested ACK from ViniciusCestarii; no objections raised.
A contributor tested cross-compilation on Arch Linux, confirmed the output matches their installed toolchain version, and approved.
- ViniciusCestarii: 'tACK 09cdb3c ... Cross-compiled for Windows on Arch Linux and the configure summary reports ... which matches the mingw-w64 version installed on my system.'
Review verdicts (DrahtBot): 1
- ACK: ViniciusCestarii
Files
0 lines under test/bench/ci.
- cmake/module/GetMingwVersion.cmake +30/-0
- CMakeLists.txt +6/-0
Card
Detects and logs the MinGW-w64 version in the CMake configure summary when cross-compiling for Windows. This aids in diagnosing toolchain-related build and runtime issues across different cross-compilation environments. The change is minor CMake configure-time logging and does not alter compiled binaries. It has received a tested ACK with no objections.