From 6b552b96e725a72ce1bc974790cd8f995a284f5d Mon Sep 17 00:00:00 2001 From: Erasin Date: Wed, 19 May 2021 17:50:40 +0800 Subject: [PATCH] target_os for test --- phper-test/src/lib.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/phper-test/src/lib.rs b/phper-test/src/lib.rs index 63e2ea91..d6bb4ad7 100644 --- a/phper-test/src/lib.rs +++ b/phper-test/src/lib.rs @@ -171,7 +171,12 @@ fn get_lib_path(exe_path: impl AsRef) -> PathBuf { let mut ext_name = OsString::new(); ext_name.push("lib"); ext_name.push(exe_stem.replace('-', "_")); + #[cfg(target_os = "linux")] ext_name.push(".so"); + #[cfg(target_os = "macos")] + ext_name.push(".dylib"); + #[cfg(target_os = "windows")] + ext_name.push(".dll"); target_dir.join(ext_name) }