summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorDavid Lönnhager <david.l@mullvad.net>2025-01-14 17:55:19 +0100
committerDavid Lönnhager <david.l@mullvad.net>2025-01-24 17:35:03 +0100
commit0f91887be47f62d906df7d43488fa4ad6bc35a76 (patch)
tree4e93af700c0766278d01fe5faaf0fb685430c065
parent7ef4b567e3fb65c2954bc17bb8ce70f86e061920 (diff)
downloadmullvadvpn-0f91887be47f62d906df7d43488fa4ad6bc35a76.tar.xz
mullvadvpn-0f91887be47f62d906df7d43488fa4ad6bc35a76.zip
Fix maybenot-ffi linkage
-rw-r--r--wireguard-go-rs/build.rs14
1 files changed, 8 insertions, 6 deletions
diff --git a/wireguard-go-rs/build.rs b/wireguard-go-rs/build.rs
index 7e87964b25..df879527fb 100644
--- a/wireguard-go-rs/build.rs
+++ b/wireguard-go-rs/build.rs
@@ -153,6 +153,8 @@ fn build_desktop_lib(target_os: Os) -> anyhow::Result<()> {
go_build.env("CC", "zig cc -target aarch64-windows");
}
}
+
+ go_build.env("CGO_LDFLAGS", format!("-L{}", target_dir.to_str().unwrap()));
}
Os::Linux => {
let out_file = format!("{out_dir}/libwg.a");
@@ -252,12 +254,12 @@ fn build_shared_maybenot_lib(out_dir: impl AsRef<Path>) -> anyhow::Result<()> {
let artifacts_dir = tmp_build_dir.join(target_triple).join(profile);
// Copy library to actual target dir
- for filename in ["maybenot_ffi.dll", "maybenot_ffi.lib"] {
- fs::copy(
- artifacts_dir.join(filename),
- out_dir.as_ref().join(filename),
- )
- .with_context(|| format!("Failed to copy {filename}"))?;
+ for (src, dest) in [
+ ("maybenot_ffi.dll", "maybenot.dll"),
+ ("maybenot_ffi.dll.lib", "maybenot.lib"),
+ ] {
+ fs::copy(artifacts_dir.join(src), out_dir.as_ref().join(dest))
+ .with_context(|| format!("Failed to copy {src}"))?;
}
Ok(())