Skip to content

Commit 71faa02

Browse files
committed
Broaden to cover all !windows !emscripten
Also copy all files and symlinks in the lib dir, to avoid worrying about platform specific prefixes/suffixes.
1 parent 548a2a8 commit 71faa02

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

sdl2-sys/build.rs

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -594,22 +594,16 @@ fn copy_dynamic_libraries(sdl2_compiled_path: &PathBuf, target_os: &str) {
594594
let src_dll_path = sdl2_bin_path.join(sdl2_dll_name);
595595

596596
copy_library_file(&src_dll_path, &target_path);
597-
} else if target_os.contains("linux") {
597+
} else if target_os != "emscripten" {
598598
// Find all libraries build and copy them, symlinks included.
599599
let lib_path = sdl2_compiled_path.join("lib");
600600
for entry in std::fs::read_dir(&lib_path).expect("Couldn't readdir lib") {
601601
let entry = entry.expect("Error looking at lib dir");
602-
let filename = entry.file_name();
603-
let filename = filename.to_string_lossy();
604-
if filename.starts_with("lib")
605-
&& (filename.ends_with(".so") || filename.contains(".so."))
606-
{
607-
if let Ok(file_type) = entry.file_type() {
608-
if file_type.is_symlink() {
609-
copy_library_symlink(&entry.path(), &target_path);
610-
} else {
611-
copy_library_file(&entry.path(), &target_path)
612-
}
602+
if let Ok(file_type) = entry.file_type() {
603+
if file_type.is_symlink() {
604+
copy_library_symlink(&entry.path(), &target_path);
605+
} else if file_type.is_file() {
606+
copy_library_file(&entry.path(), &target_path)
613607
}
614608
}
615609
}

0 commit comments

Comments
 (0)