Closed antoyo closed 6 months ago
For example, this build.rs:
build.rs
fn main() { autocfg::new().emit_sysroot_crate("std"); }
with this main.rs:
main.rs
#[cfg(has_std)] fn print() { println!("Has std"); } #[cfg(not(has_std))] fn print() { println!("Doesn't have std"); } fn main() { print(); }
Cargo.toml:
Cargo.toml
[build-dependencies.autocfg] version = "1"
Will print "Doesn't have std" when compiled with cg_gcc.
Replacing the code for emit_ir in cg_gcc with:
emit_ir
let out = cgcx.output_filenames.temp_path(OutputType::LlvmAssembly, module_name); std::fs::write(out, "").expect("write file");
doesn't seem enough to fix this issue.
I'm not sure how to get logs from autocfg.
autocfg
Fixed by #437.
For example, this
build.rs
:with this
main.rs
:Cargo.toml
:Will print "Doesn't have std" when compiled with cg_gcc.
Replacing the code for
emit_ir
in cg_gcc with:doesn't seem enough to fix this issue.
I'm not sure how to get logs from
autocfg
.