needs_rebuild

Crates.ioneeds_rebuild
lib.rsneeds_rebuild
version1.2.1
created_at2025-11-18 12:37:25.693746+00
updated_at2025-11-27 20:38:39.150673+00
descriptionA utility to check if files need to be rebuilt based on their modification times.
homepage
repository
max_upload_size
id1938391
size24,744
CJ (CjS77)

documentation

README

needs_rebuild

Checks whether a project needs to be rebuilt based on the modification times of its source files and build artifacts.

Usage

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();
    }
}
Commit count: 0

cargo fmt