]>
git.proxmox.com Git - rustc.git/blob - src/bootstrap/lib.rs
1 // Copyright 2015 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
11 //! A small helper library shared between the build system's executables
13 //! Currently this just has some simple utilities for modifying the dynamic
14 //! library lookup path.
17 use std
::ffi
::OsString
;
18 use std
::path
::PathBuf
;
20 /// Returns the environment variable which the dynamic library lookup path
21 /// resides in for this platform.
22 pub fn dylib_path_var() -> &'
static str {
23 if cfg
!(target_os
= "windows") {
25 } else if cfg
!(target_os
= "macos") {
32 /// Parses the `dylib_path_var()` environment variable, returning a list of
33 /// paths that are members of this lookup path.
34 pub fn dylib_path() -> Vec
<PathBuf
> {
35 env
::split_paths(&env
::var_os(dylib_path_var()).unwrap_or(OsString
::new()))