Maybe I'm misunderstanding but could you do something like this?
```rust
#[cfg(target="target-triple")]
println!("cargo:rerun-if-changed=file");
```