Find the cdylib file for datafusion_ffi in the given directory.
(deps_dir: &Path)
| 46 | |
| 47 | /// Find the cdylib file for datafusion_ffi in the given directory. |
| 48 | fn find_cdylib(deps_dir: &Path) -> Result<PathBuf> { |
| 49 | let lib_prefix = if cfg!(target_os = "windows") { |
| 50 | "" |
| 51 | } else { |
| 52 | "lib" |
| 53 | }; |
| 54 | let lib_ext = if cfg!(target_os = "macos") { |
| 55 | "dylib" |
| 56 | } else if cfg!(target_os = "windows") { |
| 57 | "dll" |
| 58 | } else { |
| 59 | "so" |
| 60 | }; |
| 61 | |
| 62 | let pattern = format!("{lib_prefix}datafusion_ffi.{lib_ext}"); |
| 63 | let lib_path = deps_dir.join(&pattern); |
| 64 | |
| 65 | if lib_path.exists() { |
| 66 | return Ok(lib_path); |
| 67 | } |
| 68 | |
| 69 | Err(DataFusionError::External( |
| 70 | format!("Could not find library at {}", lib_path.display()).into(), |
| 71 | )) |
| 72 | } |
| 73 | |
| 74 | pub fn get_module() -> Result<ForeignLibraryModule> { |
| 75 | let expected_version = crate::version(); |
no test coverage detected
searching dependent graphs…