Link with libwasmer-headless

This commit is contained in:
Felix Schütt
2023-01-27 09:40:05 +01:00
parent 6ecc800893
commit 3ea338c0e5

View File

@@ -1757,11 +1757,17 @@ pub(super) mod utils {
target: &Triple, target: &Triple,
files: &[PathBuf], files: &[PathBuf],
) -> Result<PathBuf, anyhow::Error> { ) -> Result<PathBuf, anyhow::Error> {
let a = OsStr::new("libwasmer.a"); let target_files = &[
let b = OsStr::new("wasmer.lib"); OsStr::new("libwasmer-headless2.a"),
OsStr::new("wasmer-headless2.lib"),
OsStr::new("libwasmer.a"),
OsStr::new("wasmer.lib"),
];
files files
.iter() .iter()
.find(|f| f.file_name() == Some(a) || f.file_name() == Some(b)) .find_map(|f| {
if target_files.iter().any(|q| Some(*q) == f.file_name()) { Some(f) } else { None }
})
.cloned() .cloned()
.ok_or_else(|| { .ok_or_else(|| {
anyhow!("Could not find libwasmer.a for {} target in the provided tarball path (files = {files:#?})", target) anyhow!("Could not find libwasmer.a for {} target in the provided tarball path (files = {files:#?})", target)