mirror of
https://github.com/Sarsoo/csbindgen.git
synced 2024-12-23 15:06:26 +00:00
Update README.md
This commit is contained in:
parent
1a306d6d12
commit
09ef58a304
@ -47,11 +47,13 @@ pub extern "C" fn my_add(x: i32, y: i32) -> i32 {
|
|||||||
Setup csbindgen code to `build.rs`.
|
Setup csbindgen code to `build.rs`.
|
||||||
|
|
||||||
```rust
|
```rust
|
||||||
|
fn main() {
|
||||||
csbindgen::Builder::default()
|
csbindgen::Builder::default()
|
||||||
.input_extern_file("lib.rs")
|
.input_extern_file("lib.rs")
|
||||||
.csharp_dll_name("nativelib")
|
.csharp_dll_name("nativelib")
|
||||||
.generate_csharp_file("../dotnet/NativeMethods.g.cs")
|
.generate_csharp_file("../dotnet/NativeMethods.g.cs")
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
It will generate this C# code.
|
It will generate this C# code.
|
||||||
|
Loading…
Reference in New Issue
Block a user