| Crates.io | needs_rebuild |
| lib.rs | needs_rebuild |
| version | 1.2.1 |
| created_at | 2025-11-18 12:37:25.693746+00 |
| updated_at | 2025-11-27 20:38:39.150673+00 |
| description | A utility to check if files need to be rebuilt based on their modification times. |
| homepage | |
| repository | |
| max_upload_size | |
| id | 1938391 |
| size | 24,744 |
Checks whether a project needs to be rebuilt based on the modification times of its source files and build artifacts.
This crate is generally most useful in build scripts (build.rs) to conditionally trigger rebuilds.
For example, to check if a rebuild is necessary for C source files:
use needs_rebuild::{needs_rebuild, ScanOptions};
fn main() {
const OUTPUT_FILE: &str = "build/lib/liboutput.a";
let options = ScanOptions::new(&["*.c", "*.h"]);
if needs_rebuild("libs/my_c_lib", OUTPUT_FILE, options) {
rebuild_c_library();
}
}