|
4 | 4 |
|
5 | 5 | from __future__ import annotations
|
6 | 6 |
|
7 |
| -import copy |
8 |
| - |
9 | 7 | from .interpreterobjects import extract_required_kwarg
|
10 | 8 | from .. import mlog
|
11 | 9 | from .. import dependencies
|
12 | 10 | from .. import build
|
13 | 11 | from ..wrap import WrapMode
|
14 |
| -from ..mesonlib import extract_as_list, stringlistify, version_compare_many, listify |
| 12 | +from ..mesonlib import extract_as_list, stringlistify, version_compare_many |
15 | 13 | from ..options import OptionKey
|
16 | 14 | from ..dependencies import Dependency, DependencyException, NotFoundDependency
|
17 | 15 | from ..interpreterbase import (MesonInterpreterObject, FeatureNew,
|
@@ -124,21 +122,17 @@ def _do_subproject(self, kwargs: TYPE_nkwargs, func_args: TYPE_nvar, func_kwargs
|
124 | 122 | # dependency('foo', static: true) should implicitly add
|
125 | 123 | # default_options: ['default_library=static']
|
126 | 124 | static = kwargs.get('static')
|
127 |
| - default_options = func_kwargs.get('default_options', {}) |
128 |
| - if static is not None and 'default_library' not in default_options: |
| 125 | + extra_default_options = {} |
| 126 | + if static is not None: |
129 | 127 | default_library = 'static' if static else 'shared'
|
130 | 128 | mlog.log(f'Building fallback subproject with default_library={default_library}')
|
131 |
| - default_options = copy.copy(default_options) |
132 |
| - default_options['default_library'] = default_library |
133 |
| - func_kwargs['default_options'] = default_options |
| 129 | + extra_default_options['default_library'] = default_library |
134 | 130 |
|
135 | 131 | # Configure the subproject
|
136 | 132 | subp_name = self.subproject_name
|
137 | 133 | varname = self.subproject_varname
|
138 | 134 | func_kwargs.setdefault('version', [])
|
139 |
| - if 'default_options' in kwargs and isinstance(kwargs['default_options'], str): |
140 |
| - func_kwargs['default_options'] = listify(kwargs['default_options']) |
141 |
| - self.interpreter.do_subproject(subp_name, func_kwargs) |
| 135 | + self.interpreter.do_subproject(subp_name, func_kwargs, extra_default_options=extra_default_options) |
142 | 136 | return self._get_subproject_dep(subp_name, varname, kwargs)
|
143 | 137 |
|
144 | 138 | def _get_subproject(self, subp_name: str) -> T.Optional[SubprojectHolder]:
|
|
0 commit comments