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
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
From c55dfbf6568d17643ddc34f5facf25e3a90acdc9 Mon Sep 17 00:00:00 2001
From: Brad King <brad.king@kitware.com>
Date: Thu, 11 Dec 2025 10:48:00 -0500
Subject: [PATCH] StdIo: Restore compilation on 32-bit MinGW

In commit e419429616 (StdIo: Restore Windows Console I/O modes on
Ctrl-C, 2025-11-26, v4.1.4~4^2) we relied on the compiler to generate a
lambda with an `operator()` for each calling convention. MSVC does
this, but the GNU compiler for MinGW does not seem to.
---
Source/cmStdIoInit.cxx | 18 +++++++++++-------
1 file changed, 11 insertions(+), 7 deletions(-)

diff --git a/Source/cmStdIoInit.cxx b/Source/cmStdIoInit.cxx
index a2fc50db7f3..49f31873bdc 100644
--- a/Source/cmStdIoInit.cxx
+++ b/Source/cmStdIoInit.cxx
@@ -93,19 +93,23 @@ public:

Globals();

+#ifdef _WIN32
+ static BOOL WINAPI CtrlHandler(DWORD /*dwCtrlType*/)
+ {
+ Get().StdErr.Destroy();
+ Get().StdOut.Destroy();
+ Get().StdIn.Destroy();
+ return FALSE;
+ }
+#endif
+
static Globals& Get();
};

#ifdef _WIN32
Globals::Globals()
{
- static auto const ctrlHandler = [](DWORD /*dwCtrlType*/) -> BOOL {
- Get().StdErr.Destroy();
- Get().StdOut.Destroy();
- Get().StdIn.Destroy();
- return FALSE;
- };
- SetConsoleCtrlHandler(ctrlHandler, TRUE);
+ SetConsoleCtrlHandler(CtrlHandler, TRUE);
}
#else
Globals::Globals() = default;
--
GitLab

11 changes: 7 additions & 4 deletions mingw-w64-cmake-bootstrap/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
_realname=cmake
pkgbase=mingw-w64-${_realname}-bootstrap
pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}-bootstrap")
pkgver=4.2.0
pkgver=4.2.1
pkgrel=1
pkgdesc="A cross-platform open-source make system"
arch=('any')
Expand All @@ -27,16 +27,19 @@ conflicts=(
provides=("${MINGW_PACKAGE_PREFIX}-cmake=${pkgver}")
source=("https://github.com/Kitware/CMake/releases/download/v${pkgver}/${_realname}-${pkgver}.tar.gz"
"0003-fix-find-python-on-mingw-aarch64.patch"
"0005-Default-to-ninja-generator.patch")
sha256sums=('4104e94657d247c811cb29985405a360b78130b5d51e7f6daceb2447830bd579'
"0005-Default-to-ninja-generator.patch"
"0100-Restore-compilation-on-32-bit-MinGW.patch")
sha256sums=('414aacfac54ba0e78e64a018720b64ed6bfca14b587047b8b3489f407a14a070'
'557b5cbc05d4d50b3a67a7892391fcaa5cd95c492cdb4338d86305d1f4a3b88a'
'426818278090704d2a12f62ef3dfd94c47b11fa2784bb842989b7f6a09ee7aa2')
'426818278090704d2a12f62ef3dfd94c47b11fa2784bb842989b7f6a09ee7aa2'
'2306d79614a10d51826c33e0dc5bc533ad06ee221a0d72ca9efb0a105574804d')

prepare() {
cd "${_realname}-${pkgver}"

patch -Np1 -i "${srcdir}/0003-fix-find-python-on-mingw-aarch64.patch"
patch -Np1 -i "${srcdir}/0005-Default-to-ninja-generator.patch"
patch -Np1 -i "${srcdir}/0100-Restore-compilation-on-32-bit-MinGW.patch"

find . -name "*.orig" -exec rm -f {} \;
}
Expand Down
51 changes: 51 additions & 0 deletions mingw-w64-cmake/0100-Restore-compilation-on-32-bit-MinGW.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
From c55dfbf6568d17643ddc34f5facf25e3a90acdc9 Mon Sep 17 00:00:00 2001
From: Brad King <brad.king@kitware.com>
Date: Thu, 11 Dec 2025 10:48:00 -0500
Subject: [PATCH] StdIo: Restore compilation on 32-bit MinGW

In commit e419429616 (StdIo: Restore Windows Console I/O modes on
Ctrl-C, 2025-11-26, v4.1.4~4^2) we relied on the compiler to generate a
lambda with an `operator()` for each calling convention. MSVC does
this, but the GNU compiler for MinGW does not seem to.
---
Source/cmStdIoInit.cxx | 18 +++++++++++-------
1 file changed, 11 insertions(+), 7 deletions(-)

diff --git a/Source/cmStdIoInit.cxx b/Source/cmStdIoInit.cxx
index a2fc50db7f3..49f31873bdc 100644
--- a/Source/cmStdIoInit.cxx
+++ b/Source/cmStdIoInit.cxx
@@ -93,19 +93,23 @@ public:

Globals();

+#ifdef _WIN32
+ static BOOL WINAPI CtrlHandler(DWORD /*dwCtrlType*/)
+ {
+ Get().StdErr.Destroy();
+ Get().StdOut.Destroy();
+ Get().StdIn.Destroy();
+ return FALSE;
+ }
+#endif
+
static Globals& Get();
};

#ifdef _WIN32
Globals::Globals()
{
- static auto const ctrlHandler = [](DWORD /*dwCtrlType*/) -> BOOL {
- Get().StdErr.Destroy();
- Get().StdOut.Destroy();
- Get().StdIn.Destroy();
- return FALSE;
- };
- SetConsoleCtrlHandler(ctrlHandler, TRUE);
+ SetConsoleCtrlHandler(CtrlHandler, TRUE);
}
#else
Globals::Globals() = default;
--
GitLab

16 changes: 12 additions & 4 deletions mingw-w64-cmake/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}"
"${MINGW_PACKAGE_PREFIX}-${_realname}-cmcldeps" \
"${MINGW_PACKAGE_PREFIX}-${_realname}-gui" \
"${MINGW_PACKAGE_PREFIX}-${_realname}-docs"))
pkgver=4.2.0
pkgver=4.2.1
_rc=""
_pkgver=${pkgver}${_rc}
pkgrel=1
Expand Down Expand Up @@ -51,12 +51,14 @@ source=("https://github.com/Kitware/CMake/releases/download/v${_pkgver}/${_realn
"0001-Disable-response-files-for-MSYS-Generator.patch"
"0002-Do-not-install-Qt-bundle-in-cmake-gui.patch"
"0003-fix-find-python-on-mingw-aarch64.patch"
"0005-Default-to-ninja-generator.patch")
sha256sums=('4104e94657d247c811cb29985405a360b78130b5d51e7f6daceb2447830bd579'
"0005-Default-to-ninja-generator.patch"
"0100-Restore-compilation-on-32-bit-MinGW.patch")
sha256sums=('414aacfac54ba0e78e64a018720b64ed6bfca14b587047b8b3489f407a14a070'
'25793edcbac05bb6d17fa9947b52ace4a6b5ccccf7758e22ae9ae022ed089061'
'f6cf6a6f2729db2b9427679acd09520af2cd79fc26900b19a49cead05a55cd1a'
'557b5cbc05d4d50b3a67a7892391fcaa5cd95c492cdb4338d86305d1f4a3b88a'
'426818278090704d2a12f62ef3dfd94c47b11fa2784bb842989b7f6a09ee7aa2')
'426818278090704d2a12f62ef3dfd94c47b11fa2784bb842989b7f6a09ee7aa2'
'2306d79614a10d51826c33e0dc5bc533ad06ee221a0d72ca9efb0a105574804d')

# Helper macros to help make tasks easier #
apply_patch_with_msg() {
Expand Down Expand Up @@ -88,6 +90,12 @@ prepare() {
apply_patch_with_msg \
0005-Default-to-ninja-generator.patch

# Taken from <https://gitlab.kitware.com/cmake/cmake/-/merge_requests/11503>.
# See <https://gitlab.kitware.com/cmake/cmake/-/merge_requests/11457#note_1743658>
# for more context.
apply_patch_with_msg \
0100-Restore-compilation-on-32-bit-MinGW.patch

find . -name "*.orig" -exec rm -f {} \;
}

Expand Down