Compiling 10MB+ resource files with qrc in cmake results in heap space allocation failures
Asked Answered
G

2

10

I'm trying to compile large resource files with qrc using CMake.

This is well known to chew up all of a computers RAM (>32GB) and cause the compiler to exit with heap allocation errors (see QTBUG-50468, QTBUG-55293, and QTBUG-54357)

Apparently if you use qmake, appending CONFIG += resources_big to your .pro file automagically fixes everything. Is there an equivalent to this setting accessible through CMake?

Giaimo answered 30/8, 2016 at 20:36 Comment(3)
Have you tried using AUTORCC?Garrott
@Torbjörn yes I am using AUTORCC.Giaimo
I can't see any reference to passing -pass 1 or -pass 2 to rcc in Qt's CMake files, so I would say it's not supported yet. Please file a suggestion in Qt's bugtracker.Deas
B
7

If you are use the the build in cmake macros, just replace

qt5_add_resources(SRC_FILES resources.qrc) # normal resources

with

qt5_add_big_resources(SRC_FILES resources.qrc) # big resources

This requires Qt5.12 and CMake 3.9.

Breastbone answered 18/6, 2019 at 7:27 Comment(0)
G
3

I've filed bug report QTBUG-55680 and will update this answer once I hear back from Qt.

Giaimo answered 1/9, 2016 at 13:42 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.