Skip to content

Commit

Permalink
give up on custom cfg setting, use cfg_aliases instead
Browse files Browse the repository at this point in the history
  • Loading branch information
Wumpf committed Oct 11, 2024
1 parent 998ee59 commit a9059f6
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 3 deletions.
7 changes: 7 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ zerocopy = { version = "0.7.32", features = ["derive"] }

[build-dependencies]
cc = "1.0.79"
cfg_aliases = "0.2.1"
nasm-rs = { version = "0.3", features = ["parallel"] }

[features]
Expand Down
6 changes: 5 additions & 1 deletion build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -327,11 +327,15 @@ mod asm {

fn main() {
// TODO(#7671): Rerun is getting linker errors on Linux right now with enabled asm features.
cfg_aliases::cfg_aliases! { asm: { any(
all(feature = "asm_nonlinux", not(target_os = "linux")),
all(feature = "asm_linux", target_os = "linux")
) } };

if cfg!(any(
all(feature = "asm_nonlinux", not(target_os = "linux")),
all(feature = "asm_linux", target_os = "linux"),
)) {
println!("cargo:rustc-check-cfg=cfg(\"asm\")");
asm::main();
}

Expand Down
11 changes: 9 additions & 2 deletions tools/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,15 @@ libc = "0.2"
rav1d = { path = "../", version = "1.0.0", default-features = false }

[features]
default = ["asm", "asm_arm64_dotprod", "asm_arm64_i8mm", "bitdepth_8", "bitdepth_16"]
asm = ["rav1d/asm"]
default = [
"asm_nonlinux",
"asm_arm64_dotprod",
"asm_arm64_i8mm",
"bitdepth_8",
"bitdepth_16",
]
asm_nonlinux = ["rav1d/asm_nonlinux"]
asm_linux = ["rav1d/asm_linux"]
asm_arm64_dotprod = ["rav1d/asm_arm64_dotprod"]
asm_arm64_i8mm = ["rav1d/asm_arm64_i8mm"]
bitdepth_8 = ["rav1d/bitdepth_8"]
Expand Down

0 comments on commit a9059f6

Please sign in to comment.