forked from RustPython/RustPython
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.rs
More file actions
29 lines (25 loc) · 800 Bytes
/
build.rs
File metadata and controls
29 lines (25 loc) · 800 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
fn main() {
rerun_if_changed("../Lib/python_builtins/*");
#[cfg(not(feature = "stdlib"))]
rerun_if_changed("../Lib/core_modules/*");
#[cfg(feature = "stdlib")]
rerun_if_changed("../../Lib/**/*");
if cfg!(windows) {
if let Ok(real_path) = std::fs::read_to_string("Lib") {
println!("rustc-env:win_lib_path={real_path:?}");
}
}
}
fn rerun_if_changed(pattern: &str) {
let glob = glob::glob(pattern).unwrap_or_else(|e| panic!("failed to glob {pattern:?}: {e}"));
for entry in glob.flatten() {
if entry.is_dir() {
continue;
}
let display = entry.display();
if display.to_string().ends_with(".pyc") {
continue;
}
println!("cargo:rerun-if-changed={display}");
}
}