Skip to content

Commit

Permalink
Remove unused code.
Browse files Browse the repository at this point in the history
  • Loading branch information
dvc94ch committed Mar 30, 2022
1 parent 7a55f18 commit 034b536
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 178 deletions.
39 changes: 0 additions & 39 deletions xcli/src/cargo/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ use std::process::Command;
mod artifact;
mod config;
mod manifest;
pub mod readelf;
mod utils;

pub use artifact::{Artifact, CrateType};
Expand Down Expand Up @@ -337,44 +336,6 @@ impl CargoBuild {
}
Ok(())
}

pub fn search_paths(&self, target_dir: &Path) -> Result<Vec<PathBuf>> {
let mut paths = vec![];
let opt = self.target.opt().to_string();
let target_dir = if let Some(triple) = self.triple.as_ref() {
target_dir.join(triple).join(&opt)
} else {
target_dir.join(&opt)
};
let deps_dir = target_dir.join("build");

for dep_dir in deps_dir.read_dir()? {
let output_file = dep_dir?.path().join("output");
if output_file.is_file() {
use std::{
fs::File,
io::{BufRead, BufReader},
};
for line in BufReader::new(File::open(output_file)?).lines() {
let line = line?;
if let Some(link_search) = line.strip_prefix("cargo:rustc-link-search=") {
let mut pie = link_search.split('=');
let (kind, path) = match (pie.next(), pie.next()) {
(Some(kind), Some(path)) => (kind, path),
(Some(path), None) => ("all", path),
_ => unreachable!(),
};
match kind {
// FIXME: which kinds of search path we interested in
"dependency" | "native" | "all" => paths.push(path.into()),
_ => (),
};
}
}
}
}
Ok(paths)
}
}

#[derive(Clone, Copy, Debug, Eq, PartialEq)]
Expand Down
139 changes: 0 additions & 139 deletions xcli/src/cargo/readelf.rs

This file was deleted.

0 comments on commit 034b536

Please sign in to comment.