Merge pull request #29 from NicholasMaselli/patch-1

Update README.md To Add Main() to the build.rs
This commit is contained in:
Yoshifumi Kawai 2023-04-28 12:08:41 +09:00 committed by GitHub
commit eaec0db14c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -47,11 +47,13 @@ pub extern "C" fn my_add(x: i32, y: i32) -> i32 {
Setup csbindgen code to `build.rs`.
```rust
csbindgen::Builder::default()
fn main() {
csbindgen::Builder::default()
.input_extern_file("lib.rs")
.csharp_dll_name("nativelib")
.generate_csharp_file("../dotnet/NativeMethods.g.cs")
.unwrap();
}
```
It will generate this C# code.