mirror of
https://github.com/Sarsoo/csbindgen.git
synced 2024-12-23 06:56:27 +00:00
Merge pull request #29 from NicholasMaselli/patch-1
Update README.md To Add Main() to the build.rs
This commit is contained in:
commit
eaec0db14c
12
README.md
12
README.md
@ -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
|
||||||
csbindgen::Builder::default()
|
fn main() {
|
||||||
.input_extern_file("lib.rs")
|
csbindgen::Builder::default()
|
||||||
.csharp_dll_name("nativelib")
|
.input_extern_file("lib.rs")
|
||||||
.generate_csharp_file("../dotnet/NativeMethods.g.cs")
|
.csharp_dll_name("nativelib")
|
||||||
.unwrap();
|
.generate_csharp_file("../dotnet/NativeMethods.g.cs")
|
||||||
|
.unwrap();
|
||||||
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
It will generate this C# code.
|
It will generate this C# code.
|
||||||
|
Loading…
Reference in New Issue
Block a user