CMake: Pass /bigobj to generated c++ files for lottietoqml
Building the lottietoqml example with MSVC, in a standalone build,
with exceptions enabled (/EHsc), failed with:
fatal error C1128: number of sections exceeded object file format
limit: compile with /bigobj
The .qml file that lottietoqml generates for USAMapWithOutlines.json
is 207 KB, and the C++ that qmlcachegen in turn generates for that is
4 MB, which results in 65789 COFF sections.
Removing the /EHsc compiler flag reduces the number and succeeds
building, which explains why the example passes when it is built
in-tree with qtlottie itself. The Qt build internals disable
exceptions for all targets, which accidentally includes examples.
To avoid the issue, pass /bigobj for MSVC, and -Wa,-mbig-obj for
MinGW, on the files generated by qt_target_qml_from_lottie().
To do that, use the newly introduced
_qt_internal_qml_get_cachegen_compiled_file() from qtdeclarative
which returns the path to the generated .cpp file, so the flag can be
tied just to the generated file rather than the whole target.
Pick-to: 6.12
Task-number: QTBUG-90820
Task-number: QTBUG-96232
Change-Id: Ie69b5532b773612c1780b0392130f932b6d3b1a3
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>