#Dependency only for proc-macros

6 messages · Page 1 of 1 (latest)

pale sigil
#

I have a proc-macro that uses a crate which will not compile for WASM. Its expansion does not rely on the crate at all, it just results in a string literal. I want to use the macro in a WASM project im building. I would assume that because the proc-macro only runs on my machine at build time, it doesn't need to be a dependency when building for WASM? What is the best way of going about this?

edgy gate
#

i mean yeah

#

it should work

#

~~until all proc macros are compiled to WASM anyway ferrisWhen ~~

weary yarrow
#

your wasm package will need a regular dependency on the proc macro crate, but when that proc macro crate is compiled it (and its dependencies) will be compiled for the host and not the target

#

so nothing special is needed, unless you have something else going on