diff options
author | Alexandru Croitor <alexandru.croitor@qt.io> | 2020-06-09 16:02:55 +0200 |
---|---|---|
committer | Alexandru Croitor <alexandru.croitor@qt.io> | 2020-06-15 20:59:15 +0200 |
commit | 2bf49e089a7a29f49a364697f87f085243d662e5 (patch) | |
tree | e05d7e530e5517341ed702644be4917c2577f947 /src/qml/Qt6QmlMacros.cmake | |
parent | ac4b9d10198ce38eb7108d758ca179aa76121c55 (diff) |
CMake: Fix failing 32 bit debug builds on MinGW
When doing a doing a 32 debug build, and trying to compile
one of the qml type registrations files, the following error can
happen
as.exe: quick_qmltyperegistrations.cpp.obj: too many sections (44466)
Fatal error: can't close src/quick/CMakeFiles/Quick.dir/quick_qmltyperegistrations.cpp.obj: File too big
The fix is to compile these specific files with the -Wa,-mbig-obj
compile flag, which uses a munged COFF format that allows more than
32k sections in one file.
Task-number: QTBUG-84886
Change-Id: Ic22e0ac409af6232db83c8a4856d5d260a0e20ff
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Diffstat (limited to 'src/qml/Qt6QmlMacros.cmake')
-rw-r--r-- | src/qml/Qt6QmlMacros.cmake | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/qml/Qt6QmlMacros.cmake b/src/qml/Qt6QmlMacros.cmake index 43a590d310..d04d663656 100644 --- a/src/qml/Qt6QmlMacros.cmake +++ b/src/qml/Qt6QmlMacros.cmake @@ -616,8 +616,16 @@ function(qt6_qml_type_registration target) ) target_sources(${target} PRIVATE ${type_registration_cpp_file}) + + # Circumvent "too many sections" error when doing a 32 bit debug build on Windows with + # MinGW. + set(additional_source_files_properties "") + if(MINGW) + set(additional_source_files_properties "COMPILE_OPTIONS" "-Wa,-mbig-obj") + endif() set_source_files_properties(${type_registration_cpp_file} PROPERTIES SKIP_AUTOGEN ON + ${additional_source_files_properties} ) # Usually for Qt Qml-like modules and qml plugins, the installation destination of the .qmltypes |