xref: /DragonOS/build-scripts/kernel_build/src/cfiles/common.rs (revision 4dd4856f933be0b4624c7f7ffa9e3d0c8c218873)
1 use std::{collections::HashSet, path::PathBuf};
2 
3 use crate::utils::FileUtils;
4 
5 pub(super) fn setup_common_files(files: &mut HashSet<PathBuf>) {
6     const DIRS: [&str; 3] = ["src/common", "src/debug/traceback", "src/libs"];
7     DIRS.iter().for_each(|dir| {
8         FileUtils::list_all_files(&dir.into(), Some("c"), true)
9             .into_iter()
10             .for_each(|f| {
11                 files.insert(f);
12             });
13     });
14 }
15 
16 pub(super) fn setup_common_include_dir(include_dirs: &mut HashSet<PathBuf>) {
17     const DIRS: [&str; 3] = ["src/include", "src/common", "src"];
18     DIRS.iter().for_each(|dir| {
19         include_dirs.insert(dir.into());
20     });
21 }
22