(deopt: &Deopt)
| 323 | } |
| 324 | |
| 325 | fn get_library_dep_trees(deopt: &Deopt) -> &'static Vec<TreeNode> { |
| 326 | static TREES: OnceCell<Vec<TreeNode>> = OnceCell::new(); |
| 327 | TREES.get_or_init(|| { |
| 328 | let executor = Executor::new(deopt).unwrap(); |
| 329 | let header_dir = deopt.get_library_build_header_path().unwrap(); |
| 330 | let headers = crate::deopt::utils::read_all_files_in_dir(&header_dir).unwrap(); |
| 331 | let mut header_trees = Vec::new(); |
| 332 | for header in headers { |
| 333 | let ext = header.extension(); |
| 334 | if ext.is_none() { |
| 335 | continue; |
| 336 | } |
| 337 | let ext = ext.unwrap().to_string_lossy().to_string(); |
| 338 | if ext != "h" && ext != "hpp" && ext != "hxx" { |
| 339 | continue; |
| 340 | } |
| 341 | let tree = executor.extract_header_dependency(&header).unwrap(); |
| 342 | if tree.is_invalid() { |
| 343 | continue; |
| 344 | } |
| 345 | header_trees.push(tree); |
| 346 | } |
| 347 | header_trees |
| 348 | }) |
| 349 | } |
| 350 | |
| 351 | pub fn get_include_lib_headers(deopt: &Deopt) -> Result<Vec<String>> { |
| 352 | let header_trees = get_library_dep_trees(deopt); |
no test coverage detected