diff --git a/gen/build/build.rs b/gen/build/build.rs index b8ff9dda..c53bef7a 100644 --- a/gen/build/build.rs +++ b/gen/build/build.rs @@ -1,29 +1 @@ -use std::io::{self, Write}; -use std::path::Path; -use std::process; - -const NOSYMLINK: &str = " -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -When building `cxx` from a git clone, git's symlink support needs -to be enabled on platforms that have it off by default (Windows). -Either use: - - $ git config --global core.symlinks true - -prior to cloning, or else use: - - $ git clone -c core.symlinks=true ... - -for the clone. - -Symlinks are only required for local development, not for building -`cxx` as a (possibly transitive) dependency from crates.io. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -"; - -fn main() { - if !Path::new("src/syntax/mod.rs").exists() { - let _ = io::stderr().lock().write_all(NOSYMLINK.as_bytes()); - process::exit(1); - } -} +include!("../../tools/cargo/build.rs"); diff --git a/gen/cmd/build.rs b/gen/cmd/build.rs index b8ff9dda..c53bef7a 100644 --- a/gen/cmd/build.rs +++ b/gen/cmd/build.rs @@ -1,29 +1 @@ -use std::io::{self, Write}; -use std::path::Path; -use std::process; - -const NOSYMLINK: &str = " -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -When building `cxx` from a git clone, git's symlink support needs -to be enabled on platforms that have it off by default (Windows). -Either use: - - $ git config --global core.symlinks true - -prior to cloning, or else use: - - $ git clone -c core.symlinks=true ... - -for the clone. - -Symlinks are only required for local development, not for building -`cxx` as a (possibly transitive) dependency from crates.io. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -"; - -fn main() { - if !Path::new("src/syntax/mod.rs").exists() { - let _ = io::stderr().lock().write_all(NOSYMLINK.as_bytes()); - process::exit(1); - } -} +include!("../../tools/cargo/build.rs"); diff --git a/gen/lib/build.rs b/gen/lib/build.rs index b8ff9dda..c53bef7a 100644 --- a/gen/lib/build.rs +++ b/gen/lib/build.rs @@ -1,29 +1 @@ -use std::io::{self, Write}; -use std::path::Path; -use std::process; - -const NOSYMLINK: &str = " -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -When building `cxx` from a git clone, git's symlink support needs -to be enabled on platforms that have it off by default (Windows). -Either use: - - $ git config --global core.symlinks true - -prior to cloning, or else use: - - $ git clone -c core.symlinks=true ... - -for the clone. - -Symlinks are only required for local development, not for building -`cxx` as a (possibly transitive) dependency from crates.io. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -"; - -fn main() { - if !Path::new("src/syntax/mod.rs").exists() { - let _ = io::stderr().lock().write_all(NOSYMLINK.as_bytes()); - process::exit(1); - } -} +include!("../../tools/cargo/build.rs"); diff --git a/macro/build.rs b/macro/build.rs index b8ff9dda..927f72b2 100644 --- a/macro/build.rs +++ b/macro/build.rs @@ -1,29 +1 @@ -use std::io::{self, Write}; -use std::path::Path; -use std::process; - -const NOSYMLINK: &str = " -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -When building `cxx` from a git clone, git's symlink support needs -to be enabled on platforms that have it off by default (Windows). -Either use: - - $ git config --global core.symlinks true - -prior to cloning, or else use: - - $ git clone -c core.symlinks=true ... - -for the clone. - -Symlinks are only required for local development, not for building -`cxx` as a (possibly transitive) dependency from crates.io. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -"; - -fn main() { - if !Path::new("src/syntax/mod.rs").exists() { - let _ = io::stderr().lock().write_all(NOSYMLINK.as_bytes()); - process::exit(1); - } -} +include!("../tools/cargo/build.rs"); diff --git a/tools/cargo/build.rs b/tools/cargo/build.rs new file mode 100644 index 00000000..b8ff9dda --- /dev/null +++ b/tools/cargo/build.rs @@ -0,0 +1,29 @@ +use std::io::{self, Write}; +use std::path::Path; +use std::process; + +const NOSYMLINK: &str = " +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +When building `cxx` from a git clone, git's symlink support needs +to be enabled on platforms that have it off by default (Windows). +Either use: + + $ git config --global core.symlinks true + +prior to cloning, or else use: + + $ git clone -c core.symlinks=true ... + +for the clone. + +Symlinks are only required for local development, not for building +`cxx` as a (possibly transitive) dependency from crates.io. +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +"; + +fn main() { + if !Path::new("src/syntax/mod.rs").exists() { + let _ = io::stderr().lock().write_all(NOSYMLINK.as_bytes()); + process::exit(1); + } +}