Open iulianR opened 4 years ago
I ran into this compilation issue as well trying to have surf as dependency in a crate that can compile to both native and wasm. Perhaps I'm missing something silly?
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
surf = { version = "2.1.0", default-features = false, features = ["h1-client"] }
[target.'cfg(target_arch = "wasm32")'.dependencies]
surf = { version = "2.1.0", default-features = false, features = ["wasm-client"] }
if I comment the first part and compile to wasm it works but not when both are there. Similar the other way around compiling native won't work if both sections are there. Is it just me not specifying the dependencies correctly?
Without cargo's resolver version 2 (which isn't stable yet), you can't properly use this crate like that. You'd need to delegate the features to the user of your crate.
Hello, seeing the
wasm-client
feature available, I expected surf to compile towasm32-unknown-unknown
as well. But it seems it pulls inopenssl
which does not compile to wasm. Am I missing something? Thanks