Let AUTOMOC handle headers of qt_reps_from_headers


qt6_reps_from_headers runs qt6_wrap_cpp on the header only to get the
metatypes json for repc, and marks the moc output HEADER_FILE_ONLY so
it is not compiled. qt6_wrap_cpp however also sets SKIP_AUTOMOC on the
header, so AUTOMOC does not moc it either. A target containing the
QObject class then failed to link with undefined references to the
vtable and signals.

Restore the header's SKIP_AUTOMOC state after the qt6_wrap_cpp call,
so AUTOMOC handles the header as usual. Compiling the moc output
instead would break projects that already compile it themselves, for
example by including moc_<name>.cpp, or that use the function on a
target that does not contain the class implementation.

This also fixes classes of such headers not being exposed to QML,
for example via QML_ELEMENT or QML_VALUE_TYPE. That was a side effect
of the SKIP_AUTOMOC workaround, because QML modules rely on AUTOMOC to
find these types.

Fixes: QTBUG-129841
Pick-to: 6.12
Change-Id: Id94834caaf493d6938436169802d4119e9be7131
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
commitd87a159a28a1e3c405227c77e21c1ce25404fba8
parent0f0e411c2666afee6a7b810e65361c1cebbf335f
authorJoerg Bornemann <joerg.bornemann@qt.io>
committerJoerg Bornemann <joerg.bornemann@qt.io>
commit timeThu, 22 Oct 2026 07:46:32 +0000