-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Labels
bugSomething isn't workingSomething isn't working
Description
EDIT: changed the title of the issue to better reflect what is happening, see comment
Hi, I was trying out this awesome tool on some toy projects, but I can't seem to be able to get conditional compilation working via #[cfg(target_feature = "...")]. Am I just doing something wrong?
If I create a project with only this code:
fn main() {
#[cfg(target_feature = "avx")]
{
println!("avx");
}
#[cfg(not(target_feature = "avx"))]
{
println!("no avx");
}
}
and this inside Cargo.toml:
[package.metadata.multivers.x86_64]
cpus = [
"x86-64",
"x86-64-v2",
"x86-64-v3",
"x86-64-v4",
"znver1",
"znver2",
"znver3",
"znver4",
"znver5",
]
then no avx is printed if ran via cargo run --release, and avx is printed if ran via RUSTFLAGS="-C target-feature=+avx" cargo run --release or RUSTFLAGS="-C target-cpu=native" cargo run --release.
However, if I run cargo +nightly multivers --out-dir . and then run the generated executable, no avx is printed when avx is expected.
I'm using Linux and my CPU is a 5000 series ryzen (znver3)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working