Skip to main content

resolve_library_filename

Function resolve_library_filename 

Source
pub fn resolve_library_filename(spec: &str, os: TargetOs) -> String
Expand description

Maps a candela dylib/import library spec to a concrete filename for os.

A bare logical name (m, sqlite3, z), no path separator and no extension, becomes the platform convention: libm.so on Linux, libm.dylib on macOS, m.dll on Windows. The same candela source therefore names the right file on every target, and the OS loader searches its standard library paths for it.

A spec that already carries a path separator or an explicit extension is treated as an explicit path and honored: an extension is kept as-is; a path with no extension is completed with the platform extension (and gets no lib prefix). This keeps absolute and workspace-relative library paths working across all three targets.