Fix some small issues and experiment with C#

This commit is contained in:
Dimitris Zervas
2024-02-27 03:01:29 +02:00
parent 62e98de539
commit a89850d410
16 changed files with 287 additions and 37 deletions

View File

@@ -1,4 +1,6 @@
use std::env;
#[cfg(feature = "dotnet")]
use csbindgen;
fn main() {
println!("cargo:rerun-if-env-changed=FRIDA_CODE");
@@ -34,4 +36,15 @@ fn main() {
println!("cargo:warning=Expected library name: {}-orig.dll", lib_name);
println!("cargo:rustc-env=LIB_NAME={}-orig.dll", lib_name);
}
#[cfg(feature = "dotnet")]
{
let lib_path = concat!(env!("CARGO_MANIFEST_DIR"), "/src/lib.rs");
let csharp_file = concat!(env!("CARGO_MANIFEST_DIR"), "/dotnet/NativeMethods.g.cs");
csbindgen::Builder::default()
.input_extern_file(lib_path)
.csharp_dll_name("deepfreeze")
.generate_csharp_file(csharp_file)
.unwrap();
}
}