MCPcopy Create free account
hub / github.com/LPC4/Full-Stack / main

Function main

crates/os-runtime/build.rs:5–23  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3use std::path::{Path, PathBuf};
4
5fn main() {
6 let manifest_dir =
7 PathBuf::from(std::env::var("CARGO_MANIFEST_DIR").expect("CARGO_MANIFEST_DIR"));
8 let out_dir = PathBuf::from(std::env::var("OUT_DIR").expect("OUT_DIR"));
9
10 println!("cargo:rerun-if-changed=build.rs");
11 for dir in ["boot", "kernel", "stdlib"] {
12 println!("cargo:rerun-if-changed={dir}");
13 watch_dir(Path::new(dir));
14 }
15
16 let mut sources = Vec::new();
17 collect_sources(&manifest_dir.join("kernel"), &manifest_dir, &mut sources);
18 collect_sources(&manifest_dir.join("stdlib"), &manifest_dir, &mut sources);
19 sources.sort_by(|a, b| a.key.cmp(&b.key));
20
21 let mut tree = Vec::new();
22 for dir in ["boot", "kernel", "stdlib"] {
23 collect_tree(&manifest_dir.join(dir), &manifest_dir, &mut tree);
24 }
25 tree.sort_by(|a, b| a.key.cmp(&b.key));
26

Callers

nothing calls this directly

Calls 3

watch_dirFunction · 0.85
collect_sourcesFunction · 0.85
render_sourcesFunction · 0.85

Tested by

no test coverage detected