mirror of
https://github.com/rust-lang/cargo.git
synced 2025-09-28 11:20:36 +00:00
Refactor get_dynamic_search_path
Will need it in a follow-up PR
This commit is contained in:
parent
29f8d039bb
commit
c1f7bb9285
@ -659,6 +659,13 @@ fn add_plugin_deps(
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn get_dynamic_search_path(path: &Path) -> &Path {
|
||||
match path.to_str().and_then(|s| s.split_once("=")) {
|
||||
Some(("native" | "crate" | "dependency" | "framework" | "all", path)) => Path::new(path),
|
||||
_ => path,
|
||||
}
|
||||
}
|
||||
|
||||
// Determine paths to add to the dynamic search path from -L entries
|
||||
//
|
||||
// Strip off prefixes like "native=" or "framework=" and filter out directories
|
||||
@ -670,12 +677,9 @@ where
|
||||
{
|
||||
let mut search_path = vec![];
|
||||
for dir in paths {
|
||||
let dir = match dir.to_str().and_then(|s| s.split_once("=")) {
|
||||
Some(("native" | "crate" | "dependency" | "framework" | "all", path)) => path.into(),
|
||||
_ => dir.clone(),
|
||||
};
|
||||
let dir = get_dynamic_search_path(dir);
|
||||
if dir.starts_with(&root_output) {
|
||||
search_path.push(dir);
|
||||
search_path.push(dir.to_path_buf());
|
||||
} else {
|
||||
debug!(
|
||||
"Not including path {} in runtime library search path because it is \
|
||||
|
Loading…
x
Reference in New Issue
Block a user