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 cc.get_export_dynamic_link_args() #3460
Conversation
c35cc26
to
f100e3e
Compare
Instead of exposing the flags to everyone, could we instead add a kwarg like |
Could be added in pkg.generate() API but that seems awfully specific method just for glib. A method on the compiler seems more natural to me and could be useful to other use cases, even if I couldn't think about one now. |
For comparison, would the following (roughly, in pseudocode) work for you in all cases:
|
We can always do it manually of course. The point here is meson already know what flag to pass for each compiler/platform to implement |
Well yes. But the thing that concerns me here is that we are getting into very specific an niche use cases. Adding a top level function that will only be used by a few projects in the entire world is heading deeply in the death-by-a-thousand-paper-cuts territory. In theory we could add a more generic function, something like:
which could then be used more generally, but that requires more use cases than just this one. This has also the very unfortunate downside that people will start doing something stupid like this:
rather than:
You may laugh, but every feature we have that can be used in a similar way has been used in exactly that incorrect way, even if we specifically tell people not to. This makes Meson look bad because if they see the former being used they will think that is how Meson should be used and the syntax on that just looks awful. |
Could add a warning in executable() if it finds export-dynamic in link_args. That would be good in any case since export_dynamic:true is pretty new and I'm sure many projects already passed that flag manually. What scares me a bit doing it manually in glib is configure script has MANY cases with different value for export_dynamic_flag_spec. Arguably most are for decades old compilers, but still each compiler could have a different flag and only meson knows that. That's why gen_export_dynamic_link_args() is a method that could be overridden by each compiler subclass. |
I personally disagree with that decision, but let's abandon this PR then. |
This is needed by glib to expose in gmodule-export-2.0.pc.