Skip to content

Specifying multiple --target at once turns on unwanted features #3182

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

Closed
gilescope opened this issue Nov 6, 2022 · 5 comments
Closed

Specifying multiple --target at once turns on unwanted features #3182

gilescope opened this issue Nov 6, 2022 · 5 comments

Comments

@gilescope
Copy link

When I'm making something that targets desktop and wasm it would be great to compile them in one go:

cargo check --target wasm32-unknown-unknown --target x86_64-apple-darwin

Unfortunately while they individually work, I think the metal feature gets turned on for the wasm target and you get lots of errors if you do them together because it then can't find mtl::. I'm not sure if this is a fundamental limitation with cargo or whether we can tweak the Cargo.toml? Would be super cool if this worked out of the box.

Describe alternatives you've considered
Could just write a shell script to compile both of them but where's the fun in that?

Additional context
Being able to compile for multiple targets at once is fairly new for cargo.

@cwfitzgerald
Copy link
Member

I didn't even know you could do that. I suspect, if it's compiling each crate once, but with merged features, we can't do anything about this, as we need target specific features for the backend.

@gilescope
Copy link
Author

gilescope commented Nov 6, 2022 via email

@teoxoy
Copy link
Member

teoxoy commented Feb 22, 2023

@gilescope I think with #3466 merged, this should now work fine. Could you give it another shot?

@daxpedda
Copy link
Contributor

Indeed, I just tried it, works.

@teoxoy
Copy link
Member

teoxoy commented Apr 17, 2023

Thanks!

@teoxoy teoxoy closed this as completed Apr 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants