From f977fea56c80d345b0b654eeee0edbd97ae6c315 Mon Sep 17 00:00:00 2001 From: Cyril Jacquet Date: Tue, 1 Aug 2023 14:13:14 +0200 Subject: [PATCH 1/2] fix "file too big" error in MinGW Debug --- crates/cxx-qt-build/src/lib.rs | 1 + crates/cxx-qt-lib/build.rs | 1 + 2 files changed, 2 insertions(+) diff --git a/crates/cxx-qt-build/src/lib.rs b/crates/cxx-qt-build/src/lib.rs index a3d49c4e3..2add094d8 100644 --- a/crates/cxx-qt-build/src/lib.rs +++ b/crates/cxx-qt-build/src/lib.rs @@ -499,6 +499,7 @@ impl CxxQtBuilder { builder.flag_if_supported("/permissive-"); // GCC + Clang builder.flag_if_supported("-std=c++17"); + builder.flag_if_supported("-Wa,-mbig-obj"); // Enable Qt Gui in C++ if the feature is enabled #[cfg(feature = "qt_gui")] builder.define("CXX_QT_GUI_FEATURE", None); diff --git a/crates/cxx-qt-lib/build.rs b/crates/cxx-qt-lib/build.rs index 1234c912d..168bc3114 100644 --- a/crates/cxx-qt-lib/build.rs +++ b/crates/cxx-qt-lib/build.rs @@ -270,6 +270,7 @@ fn main() { builder.flag_if_supported("/permissive-"); // GCC + Clang builder.flag_if_supported("-std=c++17"); + builder.flag_if_supported("-Wa,-mbig-obj"); builder.compile("cxx-qt-lib"); } From 9afa9fb1f18476d2d0c0fcc3cf6488200e2ff123 Mon Sep 17 00:00:00 2001 From: Cyril Jacquet Date: Tue, 1 Aug 2023 14:40:34 +0200 Subject: [PATCH 2/2] add compile flag /bigobj for MSVC --- crates/cxx-qt-build/src/lib.rs | 2 ++ crates/cxx-qt-lib/build.rs | 3 +++ 2 files changed, 5 insertions(+) diff --git a/crates/cxx-qt-build/src/lib.rs b/crates/cxx-qt-build/src/lib.rs index 2add094d8..5ef9c38ce 100644 --- a/crates/cxx-qt-build/src/lib.rs +++ b/crates/cxx-qt-build/src/lib.rs @@ -497,8 +497,10 @@ impl CxxQtBuilder { builder.flag_if_supported("/std:c++17"); builder.flag_if_supported("/Zc:__cplusplus"); builder.flag_if_supported("/permissive-"); + builder.flag_if_supported("/bigobj"); // GCC + Clang builder.flag_if_supported("-std=c++17"); + // MinGW requires big-obj otherwise debug builds fail builder.flag_if_supported("-Wa,-mbig-obj"); // Enable Qt Gui in C++ if the feature is enabled #[cfg(feature = "qt_gui")] diff --git a/crates/cxx-qt-lib/build.rs b/crates/cxx-qt-lib/build.rs index 168bc3114..7bc9ec32b 100644 --- a/crates/cxx-qt-lib/build.rs +++ b/crates/cxx-qt-lib/build.rs @@ -268,8 +268,11 @@ fn main() { builder.flag_if_supported("/std:c++17"); builder.flag_if_supported("/Zc:__cplusplus"); builder.flag_if_supported("/permissive-"); + builder.flag_if_supported("/bigobj"); + // GCC + Clang builder.flag_if_supported("-std=c++17"); + // MinGW requires big-obj otherwise debug builds fail builder.flag_if_supported("-Wa,-mbig-obj"); builder.compile("cxx-qt-lib");