1 use std::path::Path; 2 main()3fn main() { 4 println!("cargo:rerun-if-changed=build.rs"); 5 println!("cargo:rerun-if-changed=src/mod.rs"); 6 7 // Sometimes on Windows the git checkout does not correctly wire up the 8 // symlink from serde_derive_internals/src to serde_derive/src/internals. 9 // When this happens we'll just build based on relative paths within the git 10 // repo. 11 let mod_behind_symlink = Path::new("src/mod.rs"); 12 if !mod_behind_symlink.exists() { 13 println!("cargo:rustc-cfg=serde_build_from_git"); 14 } 15 } 16