Building autocfg won't generate the has_std cfg
antoyo opened this issue · 1 comments
antoyo commented
For example, this build.rs
:
fn main() {
autocfg::new().emit_sysroot_crate("std");
}
with this 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
:
[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:
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
.