-
Notifications
You must be signed in to change notification settings - Fork 416
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
can I run with a specified Cargo.toml path #1090
Comments
Hi Jon, What problem are you trying to solve with the Cargo switching? For now, I'm guessing you want two Cargo.toml files for building to different targets. Have you read the Cargo docs? Cargo also supports conditional dependencies:
If this somehow doesn't suit you... can you use git branches? |
I use a separate crate for the WebAssembly wrapper code and build config, so a top-level
... and then those crates have separate files Keep things simple and clear. Does this kind of workspace separation suit you, @jiyinyiyong ? |
@tijlleenders I thought about that for a while, it was not for dependencies, but for lib types:
it appears that it's still not supported according to rust-lang/cargo#4881 so I cannot use in that way. |
@gthb thanks, it might work, but I think it does not fit my current case. I have to compile a same piece of code to multiple targets. Splitting code into multiple crates add extra complexities. I have a dirty solution at now. |
Wow... that issue is three years old. My workaround would be to swap the cargo.toml in the build pipeline. |
yep. my current dirty way. |
💡 Feature description
like:
so I can keep 2 copies of
Cargo.toml
and use one of them for wasm-pack.original problem was I need to build both
staticlib
dylib
andcdylib
, they produce a conflict. I want to keep multiple versions ofCargo.toml
for switching.💻 Basic example
same as above.
The text was updated successfully, but these errors were encountered: