From 14c9e3e100c9b20d92af52aec67551f368be0c28 Mon Sep 17 00:00:00 2001 From: Jordan Petridis Date: Sat, 29 Jun 2024 19:53:09 +0300 Subject: [PATCH] target: Use the correct libdir when run in flatpak --- src/target.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/target.rs b/src/target.rs index 0b28bd3d..8e2cc0a9 100644 --- a/src/target.rs +++ b/src/target.rs @@ -134,8 +134,12 @@ impl Target { self.os.eq_ignore_ascii_case("windows") } + fn is_flatpak(&self) -> bool { + PathBuf::from("/.flatpak-info").exists() + } + pub fn default_libdir(&self) -> PathBuf { - if self.is_target_overridden || self.is_freebsd() { + if self.is_target_overridden || self.is_freebsd() || self.is_flatpak() { return "lib".into(); }