mirror of
https://github.com/rust-lang/cargo.git
synced 2025-10-01 11:30:39 +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(())
|
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
|
// Determine paths to add to the dynamic search path from -L entries
|
||||||
//
|
//
|
||||||
// Strip off prefixes like "native=" or "framework=" and filter out directories
|
// Strip off prefixes like "native=" or "framework=" and filter out directories
|
||||||
@ -670,12 +677,9 @@ where
|
|||||||
{
|
{
|
||||||
let mut search_path = vec![];
|
let mut search_path = vec![];
|
||||||
for dir in paths {
|
for dir in paths {
|
||||||
let dir = match dir.to_str().and_then(|s| s.split_once("=")) {
|
let dir = get_dynamic_search_path(dir);
|
||||||
Some(("native" | "crate" | "dependency" | "framework" | "all", path)) => path.into(),
|
|
||||||
_ => dir.clone(),
|
|
||||||
};
|
|
||||||
if dir.starts_with(&root_output) {
|
if dir.starts_with(&root_output) {
|
||||||
search_path.push(dir);
|
search_path.push(dir.to_path_buf());
|
||||||
} else {
|
} else {
|
||||||
debug!(
|
debug!(
|
||||||
"Not including path {} in runtime library search path because it is \
|
"Not including path {} in runtime library search path because it is \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user