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
Subproject links against dynamic library when building both despite -Ddefault_library=static #8047
Comments
Any chance of getting this looked at or labeled? I can work around the bug, but it's annoying having to manually specify the default_library for the subproject and that repro is extremely simple. |
@CoffeeFlux this is the expected behavior. When you set default_library in line #1 of your example, you are telling Meson that I want my libraries built statically. In order to make subprojects build statically you need -D$subproject:default_library=static or a_dep = subproject('a', default_options: ['default_library=static']).get_variable('a_dep') |
default_library is a per subproject setting and doesn't inherit from the parent project. |
I realize that I guess the problem is that |
What's the general use case of building a shared library in your current build configuration, but linking to the static one? |
Nothing, and setting the subproject to |
Right, the general issue here has nothing to do with preferring static or shared and everything to do with subprojects currently being very suboptimal for people wishing to bundle fallback dependencies -- this, and several other issues, are due to subprojects being optimized for meta-projects that build and install a collection of projects at once. This does need fixing, subproject fallback dependencies should default to static and also default to not installing the static library or headers etc. |
Minimal example: https://github.com/Myaamori/meson_mwe/tree/master/default_options_override
This is a simple project that calls a subproject in which
default_options: ['default_library=both']
is specified.Build with:
Meson will link against the shared version of the library when it should opt for the static.
Python version: 3.8.2
Meson version: 0.56.0
The text was updated successfully, but these errors were encountered: