Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 257
Nicolas Holthaus Avatar asked Aug 30 '16 20:08

Nicolas Holthaus


2 Answers

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.

like image 87
Frederic Schütze Avatar answered Oct 22 '22 02:10

Frederic Schütze


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

like image 29
Nicolas Holthaus Avatar answered Oct 22 '22 03:10

Nicolas Holthaus