Il 15/12/23 21:33, Thiago Macieira ha scritto:
Is the file format for the imported modules already standardised? Is it in the
C++ standard? I don't remember seeing it there.

If it's not a standard (ISO C++ standard or otherwise), we'd need to write
format parsers for each compiler, which raises the cost for supporting modules
considerably, especially if the compilers aren't committing to a stable format
in the first place.

There's no such thing as a standardized binary format. There's been discussions about it years ago, but it's far from being (widely?) adopted, see for instance:

https://github.com/GabrielDosReis/ipr


If anything I think this discussion ties up with the one about the future of moc, and whether it should become a compiler plugin. In principle this would bypass the problem of parsing the binary module formats -- leave it to the compiler infra, and just get the info you need out of the `import`s.


Qt should make the commitment that will support at most one module format. Any
compiler that doesn't operate on those will not have their modules supported.

I don't know if this is the same content that CMake had to support. It's
possible it isn't because CMake doesn't need to know about the classes, enums,
variables, functions, and all other entities declared, which are part of the
translation unit. Moc does need that.

... which is really, what info does moc exactly need out of a #include / import?

Thank you,
--
Giuseppe D'Angelo | giuseppe.dang...@kdab.com | Senior Software Engineer
KDAB (France) S.A.S., a KDAB Group company
Tel. France +33 (0)4 90 84 08 53, http://www.kdab.com
KDAB - Trusted Software Excellence

Attachment: smime.p7s
Description: Firma crittografica S/MIME

-- 
Development mailing list
Development@qt-project.org
https://lists.qt-project.org/listinfo/development

Reply via email to