Skip to content

Commit d869979

Browse files
committed
docs(design):config file
1 parent 78bda52 commit d869979

2 files changed

Lines changed: 16 additions & 0 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ The configuration file supports the following options:
6262
- `deps`: Dependencies (other packages & standard libraries)
6363
- `mix`: Set to true when package header files are mixed with other header files in the same directory. In this mode, only files explicitly listed in `include` are processed as package files.
6464
- `typeMap`: Custom name mapping from C types to Go types.
65+
- `symMap`: Custom name mapping from C function names to Go function names.
6566

6667
After creating the configuration file, run:
6768

doc/en/dev/llcppg.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -525,6 +525,19 @@ If `config-file` is not specified, a `llcppg.cfg` file is used in current direct
525525
}
526526
```
527527

528+
The configuration file supports the following options:
529+
530+
- `name`: The name of the generated package
531+
- `cflags`: Compiler flags for the C/C++ library
532+
- `include`: Header files to include in the binding generation
533+
- `libs`: Library flags for linking
534+
- `trimPrefixes`: Prefixes to remove from function names & type names
535+
- `cplusplus`: Set to true for C++ libraries(not support)
536+
- `deps`: Dependencies (other packages & standard libraries)
537+
- `mix`: Set to true when package header files are mixed with other header files in the same directory. In this mode, only files explicitly listed in `include` are processed as package files.
538+
- `typeMap`: Custom name mapping from C types to Go types.
539+
- `symMap`: Custom name mapping from C function names to Go function names.
540+
528541
## Process Steps
529542

530543
The llcppg tool orchestrates a three-stage pipeline that automatically generates Go bindings for C/C++ libraries by coordinating symbol table generation, signature extraction, and Go code generation components.
@@ -651,6 +664,8 @@ gogensig pkg-info-file
651664
gogensig - # read pkg-info-file from stdin
652665
```
653666

667+
### Output
668+
654669
#### Function Generation
655670
During execution, gogensig only generates functions whose corresponding mangle exists in llcppg.symb.json, determining whether to generate functions/methods with specified Go names by parsing the go field corresponding to the mangle.
656671

0 commit comments

Comments
 (0)