mirror of
https://github.com/mappu/miqt.git
synced 2024-12-23 09:28:36 +00:00
26 lines
774 B
Markdown
26 lines
774 B
Markdown
|
# 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`
|