diff --git a/tools/export-validator/build.rs b/tools/export-validator/build.rs index 0b4332fd1a..49b222e75a 100644 --- a/tools/export-validator/build.rs +++ b/tools/export-validator/build.rs @@ -1,4 +1,7 @@ -use std::{env, path::PathBuf}; +use std::{ + env, fs, + path::{Path, PathBuf}, +}; fn main() -> anyhow::Result<()> { let manifest_dir = env::var("CARGO_MANIFEST_DIR")?; @@ -7,6 +10,9 @@ fn main() -> anyhow::Result<()> { libs_dir.push("lib3mf"); libs_dir.push("libs"); + let out_dir = env::var("OUT_DIR")?; + let out_dir = Path::new(&out_dir); + // This is necessary to link against the dynamic library. println!("cargo:rustc-link-search=native={}", libs_dir.display()); println!("cargo:rustc-link-lib=dylib=3mf"); @@ -15,6 +21,12 @@ fn main() -> anyhow::Result<()> { if cfg!(target_family = "unix") { println!("cargo:rustc-link-arg=-Wl,-rpath,{}", libs_dir.display()); } + if cfg!(target_family = "windows") { + fs::copy( + libs_dir.join("3mf.dll"), + out_dir.join("../../../deps/3mf.dll"), + )?; + } Ok(()) } diff --git a/tools/export-validator/lib3mf/libs/3mf.dll b/tools/export-validator/lib3mf/libs/3mf.dll new file mode 100644 index 0000000000..1e45f095fb Binary files /dev/null and b/tools/export-validator/lib3mf/libs/3mf.dll differ diff --git a/tools/export-validator/lib3mf/libs/3mf.lib b/tools/export-validator/lib3mf/libs/3mf.lib new file mode 100644 index 0000000000..7285b5c3c0 Binary files /dev/null and b/tools/export-validator/lib3mf/libs/3mf.lib differ