add helper to target bin path
This commit is contained in:
parent
eb1a5c9bb3
commit
6867d6492b
1 changed files with 8 additions and 0 deletions
|
@ -51,6 +51,14 @@ pub fn make_target_lib_path(sysroot: &Path, target_triple: &str) -> PathBuf {
|
||||||
PathBuf::from_iter([sysroot, Path::new(&rustlib_path), Path::new("lib")])
|
PathBuf::from_iter([sysroot, Path::new(&rustlib_path), Path::new("lib")])
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Returns a path to the target's `bin` folder within its `rustlib` path in the sysroot. This is
|
||||||
|
/// where binaries are usually installed, e.g. the self-contained linkers, lld-wrappers, LLVM tools,
|
||||||
|
/// etc.
|
||||||
|
pub fn make_target_bin_path(sysroot: &Path, target_triple: &str) -> PathBuf {
|
||||||
|
let rustlib_path = rustc_target::target_rustlib_path(sysroot, target_triple);
|
||||||
|
PathBuf::from_iter([sysroot, Path::new(&rustlib_path), Path::new("bin")])
|
||||||
|
}
|
||||||
|
|
||||||
#[cfg(unix)]
|
#[cfg(unix)]
|
||||||
fn current_dll_path() -> Result<PathBuf, String> {
|
fn current_dll_path() -> Result<PathBuf, String> {
|
||||||
use std::ffi::{CStr, OsStr};
|
use std::ffi::{CStr, OsStr};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue