File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change 1+ use std:: path:: Path ;
2+
3+ fn main ( ) {
4+ // Sometimes on Windows the git checkout does not correctly wire up the
5+ // symlink from serde_derive_internals/src to serde_derive/src/internals.
6+ // When this happens we'll just build based on relative paths within the git
7+ // repo.
8+ let mod_behind_symlink = Path :: new ( "src/mod.rs" ) ;
9+ if !mod_behind_symlink. exists ( ) {
10+ println ! ( "cargo:rustc-cfg=serde_build_from_git" ) ;
11+ }
12+ }
Original file line number Diff line number Diff line change @@ -40,7 +40,8 @@ extern crate syn;
4040extern crate proc_macro2;
4141extern crate quote;
4242
43- #[ path = "src/mod.rs" ]
43+ #[ cfg_attr( serde_build_from_git, path = "../serde_derive/src/internals/mod.rs" ) ]
44+ #[ cfg_attr( not( serde_build_from_git) , path = "src/mod.rs" ) ]
4445mod internals;
4546
4647pub use internals:: * ;
You can’t perform that action at this time.
0 commit comments