From 28da24a1a64fc901b858b586d4ce90bdca20d153 Mon Sep 17 00:00:00 2001 From: Alexey Edelev Date: Thu, 6 Jan 2022 15:21:40 +0100 Subject: [PATCH] Enable -bigobj by default for Qt Add '-bigobj' for MSVC and '-Wa,-mbig-obj' for MINGW to the PlatformCommonInternal compiler options. Pick-to: 6.3 Change-Id: I706b83d189a116a3ab6f93d59593e237e66b0e2e Reviewed-by: Thiago Macieira --- cmake/QtInternalTargets.cmake | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/cmake/QtInternalTargets.cmake b/cmake/QtInternalTargets.cmake index fc98e6215df..c1d97da641c 100644 --- a/cmake/QtInternalTargets.cmake +++ b/cmake/QtInternalTargets.cmake @@ -196,7 +196,10 @@ if (MSVC) ) endif() - target_compile_options(PlatformCommonInternal INTERFACE -Zc:wchar_t) + target_compile_options(PlatformCommonInternal INTERFACE + -Zc:wchar_t + -bigobj + ) target_compile_options(PlatformCommonInternal INTERFACE $<$>:-guard:cf -Gw> @@ -208,6 +211,10 @@ if (MSVC) ) endif() +if(MINGW) + target_compile_options(PlatformCommonInternal INTERFACE -Wa,-mbig-obj) +endif() + if (GCC AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "9.2") target_compile_options(PlatformCommonInternal INTERFACE $<$:-Wsuggest-override>) endif()