[Interest] Very large QRC file

Thiago Macieira thiago.macieira at intel.com
Thu Mar 24 01:18:44 CET 2016


On quarta-feira, 23 de março de 2016 21:49:41 PDT Scott Aron Bloom wrote:
> What does this flag do?  Is there an equivalent flag for CMake???

It makes rcc operate in a two-pass mode. Without it, resource compilation is:

$$QMAKE_RCC $$QMAKE_RESOURCE_FLAGS ${QMAKE_FILE_IN} -o ${QMAKE_FILE_OUT}

and the output file is then compiled.

With it, it becomes:

    $$QMAKE_RCC $$QMAKE_RESOURCE_FLAGS ${QMAKE_FILE_IN} -pass 1 -o $$RCC_CPP 
&& \
    $$RCC_CXX -c $$RCC_CPP $$RCC_CXX_O_FLAG$$RCC_TMP && \
    $$QMAKE_RCC $$QMAKE_RESOURCE_FLAGS ${QMAKE_FILE_IN} -pass 2 -temp $
$RCC_TMP -o ${QMAKE_FILE_OUT}

In pass 1, rcc calculates the size of the data and simply fills it with zeroes. 
Then the compiler is called, to produce an object file. Then the second pass 
kicks in and fills the data in the dummy .o, producing the result.

Also note how the compiler is called without any optimisation flags, which is 
required (the compiler can't deduce that the data is zeroes) and also helps 
with the build time because then the compiler won't try to optimise.

This isn't enabled by default because it doesn't work under some scenarios:
 * LTCG
 * generators that don't support custom commands (Xcodeproj, for example)
 * object file formats that "compress" the data (a large section of zeroes is 
   highly compressible)

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center




More information about the Interest mailing list