(&self, header: &Path)
| 76 | |
| 77 | impl Executor { |
| 78 | fn extract_header_dependency(&self, header: &Path) -> Result<TreeNode> { |
| 79 | let header_path = self.deopt.get_library_build_header_path()?; |
| 80 | let output = Command::new("clang++") |
| 81 | .current_dir(&header_path) |
| 82 | .arg("-fsyntax-only") |
| 83 | .arg("-H") |
| 84 | .arg("-I.") |
| 85 | .arg(header) |
| 86 | .stdout(Stdio::null()) |
| 87 | .stderr(Stdio::piped()) |
| 88 | .output() |
| 89 | .expect("fail to extract header dependency"); |
| 90 | if !output.status.success() { |
| 91 | log::trace!("{}", String::from_utf8_lossy(&output.stderr)); |
| 92 | return Ok(TreeNode::new_invalid()); |
| 93 | } |
| 94 | let base_name = header |
| 95 | .to_str() |
| 96 | .unwrap() |
| 97 | .strip_prefix(header_path.to_str().unwrap()) |
| 98 | .unwrap(); |
| 99 | let base_name = [".", base_name].concat(); |
| 100 | let output = String::from_utf8_lossy(&output.stderr).to_string(); |
| 101 | let mut tree = parse_dependency_tree(&output, &base_name, &header_path)?; |
| 102 | tree.get_clean_root(&self.deopt); |
| 103 | Ok(tree) |
| 104 | } |
| 105 | } |
| 106 | |
| 107 | fn get_layer_child(layered_nodes: Vec<(usize, &str)>, depth: usize) -> Vec<TreeNode> { |
no test coverage detected