From 4bd23cf19563b37057841492653429c21ed8ef61 Mon Sep 17 00:00:00 2001 From: John Ralls Date: Mon, 5 Jan 2026 17:44:53 -0800 Subject: [PATCH] Mingw 64-bit uses libgcc_s_seh-1 instead of libgcc_s_dw2-1. --- CMakeLists.txt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 818164b401..7ce07851e2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1062,9 +1062,13 @@ if (WIN32) if (NOT LIBSTDC++) message(FATAL_ERROR "libstdc++ not found.") endif() - find_file(LIBDW2 libgcc_s_dw2-1.dll) + if ($ENV{MSYSTEM} STREQUAL "MINGW32") + find_file(LIBDW2 libgcc_s_dw2-1.dll) + else() + find_file(LIBDW2 libgcc_s_seh-1.dll) + endif() if (NOT LIBDW2) - message(FATAL_ERROR "libgcc_s_dw2-l not found.") + message(FATAL_ERROR "GCC exception library not found.") endif() set(MINGW_DLLS ${LIBSTDC++} ${LIBDW2}) install(PROGRAMS ${MINGW_DLLS} DESTINATION ${CMAKE_INSTALL_BINDIR})