You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a Rust project with multiple embedded binaries. Those need different linker options, and thus different build scripts (the build script manages the linker script, which needs to be modified).
Proposed Solution
My preferred solution would be to have a build attribute in the [[bin]] section that I can set, as originally proposed here. Alternatively, it would be sufficient to simply expose the binary name to the build script, so that it may match on it and alter its behavior. As a third option, the ability to set rustflags per binary would probably help me out as well. But I think that per binary build scripts are the most general solution to this problem.
Notes
This is a similar, but more general request than #1430 and #1581.
The text was updated successfully, but these errors were encountered:
This looks like a solution, although I cannot manage to pass it multiple times. (Setting rustc-link-arg multiple times works though, but obviously not per binary.) I think this may be a bug worthy of its own issue.
While my specific use case is sufficiently resolved, I'd still like to keep this issue open for the general feature. The number of references to the related issues shows that there is a lot of need for it.
I'm going to close in preference to #1430. They seem sufficiently similar that I don't think the solution would be developed independently. For now, I think cargo:rustc-link-arg-bin should help with linker arguments specifically.
Problem
I have a Rust project with multiple embedded binaries. Those need different linker options, and thus different build scripts (the build script manages the linker script, which needs to be modified).
Proposed Solution
My preferred solution would be to have a
build
attribute in the[[bin]]
section that I can set, as originally proposed here. Alternatively, it would be sufficient to simply expose the binary name to the build script, so that it may match on it and alter its behavior. As a third option, the ability to setrustflags
per binary would probably help me out as well. But I think that per binary build scripts are the most general solution to this problem.Notes
This is a similar, but more general request than #1430 and #1581.
The text was updated successfully, but these errors were encountered: