miqt/cmd/genbindings/README.md

26 lines
774 B
Markdown
Raw Normal View History

2024-08-25 04:06:16 +00:00
# genbindings
The `genbindings` program regenerates the qt bindings.
## Archicture design
Bindings are generated as follows:
1. Scan input directory for header files.
2. For each header file:
3. Run `clang --ast-dump=json` to get a JSON ast.
- This is somewhat slow, the results will be cached in `./cachedir` after the first run.
4. Convert Clang AST to our own intermediate representation.
5. Emit CABI cpp/h pair.
- The CABI is a projection of Qt into plain C. The translation unit itself is C++, but the header can be used as extern c.
6. Emit Go binding file.
## Configuration
It's tested to work on with Debian 12 / Qt 5.15 / Clang 14 / GCC 12.
You should check the following configuration:
- Input directories containing Qt headers
- All of `exceptions.go`