You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
514 B
Rust
21 lines
514 B
Rust
3 years ago
|
use std::{env, fs, process};
|
||
5 years ago
|
|
||
|
fn main() {
|
||
3 years ago
|
let ld_script_path = match env::var("LD_SCRIPT_PATH") {
|
||
|
Ok(var) => var,
|
||
|
_ => process::exit(0),
|
||
|
};
|
||
5 years ago
|
|
||
3 years ago
|
let files = fs::read_dir(ld_script_path).unwrap();
|
||
|
files
|
||
|
.filter_map(Result::ok)
|
||
|
.filter(|d| {
|
||
|
if let Some(e) = d.path().extension() {
|
||
|
e == "ld"
|
||
|
} else {
|
||
|
false
|
||
|
}
|
||
|
})
|
||
|
.for_each(|f| println!("cargo:rerun-if-changed={}", f.path().display()));
|
||
5 years ago
|
}
|