diff --git a/src/build.rs b/src/build.rs index bb0daff..096bd26 100644 --- a/src/build.rs +++ b/src/build.rs @@ -147,19 +147,23 @@ fn build_def_file( // Create the .def output file let def_file = cargo_util::paths::create(targetdir.join(format!("{name}.def")))?; - write_def_file(dll_file, def_file)?; + write_def_file(name, dll_file, def_file)?; } Ok(()) } -fn write_def_file(dll_file: object::File, mut def_file: W) -> anyhow::Result { +fn write_def_file( + name: &str, + dll_file: object::File, + mut def_file: W, +) -> anyhow::Result { use object::read::Object; + writeln!(def_file, "LIBRARY \"{name}.dll\"")?; writeln!(def_file, "EXPORTS")?; for export in dll_file.exports()? { - def_file.write_all(b"\t")?; def_file.write_all(export.name())?; def_file.write_all(b"\n")?; }