Skip to content

Commit 9621e88

Browse files
authored
Update DevManual.md (#1920)
Some info about the codebase for future contributors
1 parent 88204f7 commit 9621e88

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

docs/DevManual.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,26 @@ The target runtime needs to support calling native methods and this is usually
6565
implemented with an FFI (foreign function interface) in the target language VM
6666
virtual machine). In .NET this is done via the P/Invoke system.
6767

68+
69+
# For Contributors
70+
71+
## Updating Parser Bindings
72+
73+
CppSharp uses its own code, to parse and generate C# bindings from (clang) source.
74+
- You will need the following [headers package](https://github.com/mono/CppSharp/releases/download/CppSharp/headers.zip), which will allow you to generate bindings for all platforms.
75+
- Simply place these in `<repo_root_dir>/build/headers/<target_triple>`.
76+
- To update the clang bindings, first run the project `CppSharp.Parser.Bootstrap`.
77+
- This will generate a source code patch in a folder called 'BootstrapPatch'.
78+
- Finally, run `CppSharp.Parser.Gen` to generate the C# and C++/CLI bindings.
79+
- This project will first build and run using the old bindings and then override the files with the bootstrap patch source
80+
- This means it's possible you need to run this process twice to generate all bindings (in cases where new bindings will cause new source to be parsed, eg. when new language features are added)
81+
82+
- To add or remove code in parser source that is not yet automatically generated
83+
- Make your changes
84+
- Copy them to a new folder in `<repo_root_dir>/BootstrapPatch`
85+
- Discard the copied changes using git
86+
- Finally, run `CppSharp.Parser.Gen` to generate the C# and C++/CLI bindings
87+
6888
# Similar Tools
6989

7090
- SWIG

0 commit comments

Comments
 (0)