aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/interpreter/dependencyfallbacks.py
diff options
context:
space:
mode:
Diffstat (limited to 'mesonbuild/interpreter/dependencyfallbacks.py')
-rw-r--r--mesonbuild/interpreter/dependencyfallbacks.py11
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