-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Add possibility to exclude binaries from being built on specific platforms #3138
Comments
Thanks for the report! Yeah in Cargo right now this isn't too easy, but you can work around this with |
@alexcrichton that's what I'm currently doing. But it needs a |
found a workoround via a |
…ux and osx (workaround of this issue: rust-lang/cargo#3138)
…ux and osx (workaround of this issue: rust-lang/cargo#3138)
Hey there. I am going to close this since more discussions happens in #9208 for the same issue. Thank you! |
I have
src/bin/linux-only.rs
which does some things which work on Linux only (e.g. libc bindings which only exist on Linux). I want to exclude that file from being built on OS X.Could you add a way to exclude those, e.g.
or (and that's probably the better way as it doesn't need new syntax): just remove the error
error: main function not found
when there's a#![cfg(target_os = "linux")]
at the top ofsrc/bin/linux-only.rs
Disclaimer: I'm fairly new to rust so maybe I'm doing something wrong. I read through the Cargo.toml docs and didn't find a way to make this work, I also did not get a satisfying answer on this SO post.
The text was updated successfully, but these errors were encountered: