Files
cmake/Help/release/dev/automoc-cxx-modules.rst
T
Joerg Bornemann 6280cc3df9 Autogen: Add AUTOMOC support for C++ module units
Process C++ module interface and partition units that are members of a
FILE_SET of type CXX_MODULES.  moc is run on such units and its
generated output is compiled as a module implementation unit of the same
module, as its own scanned translation unit rather than folded into
mocs_compilation.cpp.  Macro-less units get an empty placeholder; module
units and their dependencies are tracked in the autogen depfile and as
byproducts for correct incremental rebuilds.

This requires Qt 6.13, whose moc supports C++ module units.  With older
Qt nothing can be generated for a module unit, so a meta-object macro
found in one is reported as an error rather than left to fail later in
the compiler or the linker.  Such a unit is no longer handled as an
ordinary source, which also means its moc include directives are not
honored and AUTOUIC does not process it.

moc rejects a meta-object macro in a module implementation unit or a
private module fragment, and AUTOMOC does not work around that.
2026-09-10 13:13:11 +02:00

9 lines
378 B
ReStructuredText

automoc-cxx-modules
-------------------
* :prop_tgt:`AUTOMOC` now processes C++ module interface and partition
units that are members of a ``FILE_SET`` of type ``CXX_MODULES``.
``moc`` is run on such units and its generated output is compiled as a
module implementation unit of the same module. This requires Qt 6.13
or newer, whose ``moc`` supports C++ module units.