diff options
author | Xavier Claessens <xavier.claessens@collabora.com> | 2021-08-04 11:30:27 -0400 |
---|---|---|
committer | Xavier Claessens <xclaesse@gmail.com> | 2021-08-23 10:52:18 -0400 |
commit | e646130ef1a703a3624cff4ca11f926703a6fcf4 (patch) | |
tree | afc6527bdd1e01de853fa4ecdab66ee2a8baf75b /mesonbuild/interpreter/dependencyfallbacks.py | |
parent | 0063eb251e836e777b427cbe59b43ab937ac1924 (diff) | |
download | meson-e646130ef1a703a3624cff4ca11f926703a6fcf4.zip meson-e646130ef1a703a3624cff4ca11f926703a6fcf4.tar.gz meson-e646130ef1a703a3624cff4ca11f926703a6fcf4.tar.bz2 |
interpreter: Fix dependency(..., static: true) fallback
It should build the fallback subprject with default_library=static and
override the dependency for both static=True and static kwarg not given.
Fixes: #8050.
Diffstat (limited to 'mesonbuild/interpreter/dependencyfallbacks.py')
-rw-r--r-- | mesonbuild/interpreter/dependencyfallbacks.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/mesonbuild/interpreter/dependencyfallbacks.py b/mesonbuild/interpreter/dependencyfallbacks.py index 5934cbd..4baa5cf 100644 --- a/mesonbuild/interpreter/dependencyfallbacks.py +++ b/mesonbuild/interpreter/dependencyfallbacks.py @@ -116,6 +116,17 @@ class DependencyFallbacksHolder(MesonInterpreterObject): mlog.log('Looking for a fallback subproject for the dependency', mlog.bold(self.display_name)) + # dependency('foo', static: true) should implicitly add + # default_options: ['default_library=static'] + static = kwargs.get('static') + default_options = stringlistify(func_kwargs.get('default_options', [])) + if static is not None and not any('default_library' in i for i in default_options): + default_library = 'static' if static else 'shared' + opt = f'default_library={default_library}' + mlog.log(f'Building fallback subproject with {opt}') + default_options.append(opt) + func_kwargs['default_options'] = default_options + # Configure the subproject subp_name = self.subproject_name varname = self.subproject_varname |