Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix build on wasm32-unknown-unknown #3367

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,10 @@ tracing = [
]
scenechange = []
serialize = ["serde", "toml", "v_frame/serialize", "serde-big-array", "av1-grain/serialize"]
wasm = ["wasm-bindgen"]

# Left here for compatibility reasons.
# Does not do anything, the wasm target is auto-detected.
wasm = []

# Enables debug dumping of lookahead computation results, specifically:
# - i-qres.png: quarter-resolution luma planes,
Expand Down Expand Up @@ -106,7 +109,6 @@ console = { version = "0.15", optional = true }
fern = { version = "0.6", optional = true }
itertools = "0.12"
simd_helpers = "0.1"
wasm-bindgen = { version = "0.2.90", optional = true }
nom = { version = "7.1.3", optional = true }
new_debug_unreachable = "1.0.4"
av1-grain = "0.2.3"
Expand Down Expand Up @@ -155,6 +157,10 @@ rand_chacha = "0.3"
[target.'cfg(any(decode_test, decode_test_dav1d))'.dependencies]
system-deps = "6"

# WASM
[target.'cfg(all(target_arch = "wasm32", target_os = "unknown", target_vendor = "unknown"))'.dependencies]
wasm-bindgen = "0.2.90"

[[bin]]
name = "rav1e"
required-features = ["binaries"]
Expand All @@ -167,6 +173,8 @@ bench = false

[lib]
bench = false
# cdylib is required for wasm32-unknown-unknown
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is potentially annoying, rustwasm/wasm-pack#1297 should fix it.

crate-type = ["lib", "cdylib"]

[[bench]]
name = "bench"
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ mod serialize {

mod wasm_bindgen {
cfg_if::cfg_if! {
if #[cfg(feature="wasm")] {
if #[cfg(all(target_arch = "wasm32", target_os = "unknown", target_vendor = "unknown"))] {
pub use wasm_bindgen::prelude::*;
} else {
pub use noop_proc_macro::wasm_bindgen;
Expand Down
Loading