xref: /DragonOS/build-scripts/kernel_build/src/cfiles/common.rs (revision 55e6f0b65f91b32638fd56581f711a816eccdcd1)
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