-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Description
Hello, I need to export some specific symbols from the binaries that use my library (including the examples that are in the same crate), and to do this, I have to pass some extra linker args since nothing is exported by default. But unfortunately, .cargo/config.toml doesn't allow to specify extra compiler/linker args with fine granularity: it applies the build.rustflags
option contents to every compiler call, which is unfortunate since the dependencies of my library (and my library itself) do not contain the required symbols and thus fail to link.
Ideally, I'd love to have a language attribute that would allow forwarding extra compiler args from source, but it looks like a serious and probably controversial change, so I believe this issue should be handled on cargo level.
As to my taste, the most obvious place to put extra flags is cargo.toml (since it's the place where some people, including me and the reporter of #3261, have tried to put this flag :)), but since it has not been done already, I can guess there are some arguments against it? So please share your thoughts.
Thanks!