Lines Matching +full:cross +full:- +full:spawn
3 //! will accept them, rather than hard-coding specific version support.
11 //! [build-dependencies]
16 //! example, to test for 128-bit integer support, it might look like:
32 //! If the type test succeeds, this will write a `cargo:rustc-cfg=has_i128` line
33 //! for Cargo, which translates to Rust arguments `--cfg has_i128`. Then in the
94 /// This looks like: `cargo:rustc-cfg=CFG`
96 /// Cargo will use this in arguments to rustc, like `--cfg CFG`.
98 println!("cargo:rustc-cfg={}", cfg); in emit()
103 /// This looks like: `cargo:rerun-if-changed=PATH`
108 println!("cargo:rerun-if-changed={}", path); in rerun_path()
114 /// This looks like: `cargo:rerun-if-env-changed=VAR`
119 println!("cargo:rerun-if-env-changed={}", var); in rerun_env()
127 pub fn new() -> AutoCfg { in new()
136 /// - `rustc` can't be executed, from `RUSTC` or in the `PATH`.
137 /// - The version output from `rustc` can't be parsed.
138 /// - `OUT_DIR` is not set in the environment, or is not a writable directory.
140 pub fn new() -> Result<Self, Error> { in new()
151 /// - `rustc` can't be executed, from `RUSTC` or in the `PATH`.
152 /// - The version output from `rustc` can't be parsed.
153 /// - `dir` is not a writable directory.
155 pub fn with_dir<T: Into<PathBuf>>(dir: T) -> Result<Self, Error> { in with_dir()
193 pub fn probe_rustc_version(&self, major: usize, minor: usize) -> bool { in probe_rustc_version()
205 fn probe<T: AsRef<[u8]>>(&self, code: T) -> Result<bool, Error> { in probe()
212 .arg("--crate-name") in probe()
214 .arg("--crate-type=lib") in probe()
215 .arg("--out-dir") in probe()
217 .arg("--emit=llvm-ir"); in probe()
220 command.arg("--target").arg(target); in probe()
225 command.arg("-").stdin(Stdio::piped()); in probe()
226 let mut child = try!(command.spawn().map_err(error::from_io)); in probe()
246 pub fn probe_sysroot_crate(&self, name: &str) -> bool { in probe_sysroot_crate()
265 pub fn probe_path(&self, path: &str) -> bool { in probe_path()
271 /// Any non-identifier characters in the `path` will be replaced with
293 pub fn probe_trait(&self, name: &str) -> bool { in probe_trait()
300 /// Any non-identifier characters in the trait `name` will be replaced with
322 pub fn probe_type(&self, name: &str) -> bool { in probe_type()
329 /// Any non-identifier characters in the type `name` will be replaced with
351 pub fn probe_expression(&self, expr: &str) -> bool { in probe_expression()
370 pub fn probe_constant(&self, expr: &str) -> bool { in probe_constant()
383 fn mangle(s: &str) -> String { in mangle()
396 ) -> bool { in dir_contains_target()
414 fn rustflags(target: &Option<OsString>, dir: &Path) -> Vec<String> { in rustflags()
415 // Starting with rust-lang/cargo#9601, shipped in Rust 1.55, Cargo always sets in rustflags()
432 // cross-compilation environment. Sadly, we don't have a way to detect in rustflags()
433 // when we're building HOST artifact in a cross-compilation environment, in rustflags()
434 // so for now we only apply RUSTFLAGS when cross-compiling an artifact. in rustflags()
436 // See https://github.com/cuviper/autocfg/pull/10#issuecomment-527575030. in rustflags()
442 …://github.com/rust-lang/cargo/blob/69aea5b6f69add7c51cca939a79644080c0b0ba0/src/cargo/core/compile… in rustflags()