1 // Various utilities for working with dylib paths.
3 // This file is meant to be included directly to avoid a dependency on the bootstrap library from
4 // the rustc and rustdoc wrappers. This improves compilation time by reducing the linking time.
6 /// Returns the environment variable which the dynamic library lookup path
7 /// resides in for this platform.
8 pub fn dylib_path_var() -> &'static str {
9 if cfg!(target_os = "windows") {
11 } else if cfg!(target_os = "macos") {
13 } else if cfg!(target_os = "haiku") {
20 /// Parses the `dylib_path_var()` environment variable, returning a list of
21 /// paths that are members of this lookup path.
22 pub fn dylib_path() -> Vec<PathBuf> {
23 let var = match env::var_os(dylib_path_var()) {
25 None => return vec![],
27 env::split_paths(&var).collect()