aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/dependencies/base.py
diff options
context:
space:
mode:
authorDaniel Mensinger <daniel@mensinger-ka.de>2021-06-21 15:50:38 +0200
committerDaniel Mensinger <daniel@mensinger-ka.de>2021-06-22 21:09:19 +0200
commit0c4dd81c4db228492a483b9aade3450d0ed408e2 (patch)
tree58f2f9cb2565f6c35d7cc622cab690fbab13c42d /mesonbuild/dependencies/base.py
parent7588dbc587afd3de931be60472f8919ae17dd396 (diff)
downloadmeson-0c4dd81c4db228492a483b9aade3450d0ed408e2.zip
meson-0c4dd81c4db228492a483b9aade3450d0ed408e2.tar.gz
meson-0c4dd81c4db228492a483b9aade3450d0ed408e2.tar.bz2
fix: Handling BothLibraries objects (fixes #8907)
Diffstat (limited to 'mesonbuild/dependencies/base.py')
-rw-r--r--mesonbuild/dependencies/base.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/mesonbuild/dependencies/base.py b/mesonbuild/dependencies/base.py
index e12c697..7240a81 100644
--- a/mesonbuild/dependencies/base.py
+++ b/mesonbuild/dependencies/base.py
@@ -29,7 +29,7 @@ from ..interpreterbase import FeatureDeprecated
if T.TYPE_CHECKING:
from ..compilers.compilers import Compiler
from ..environment import Environment
- from ..build import BuildTarget
+ from ..build import BuildTarget, BothLibraries
from ..mesonlib import FileOrString
@@ -222,8 +222,8 @@ class Dependency(HoldableObject):
class InternalDependency(Dependency):
def __init__(self, version: str, incdirs: T.List[str], compile_args: T.List[str],
- link_args: T.List[str], libraries: T.List['BuildTarget'],
- whole_libraries: T.List['BuildTarget'], sources: T.List['FileOrString'],
+ link_args: T.List[str], libraries: T.List[T.Union['BuildTarget', 'BothLibraries']],
+ whole_libraries: T.List[T.Union['BuildTarget', 'BothLibraries']], sources: T.List['FileOrString'],
ext_deps: T.List[Dependency], variables: T.Dict[str, T.Any]):
super().__init__(DependencyTypeName('internal'), {})
self.version = version
@@ -237,6 +237,11 @@ class InternalDependency(Dependency):
self.ext_deps = ext_deps
self.variables = variables
+ # Deal with BothLibraries
+ from ..build import BothLibraries
+ self.libraries = [x.get_preferred_library() if isinstance(x, BothLibraries) else x for x in self.libraries]
+ self.whole_libraries = [x.static if isinstance(x, BothLibraries) else x for x in self.whole_libraries]
+
def __deepcopy__(self, memo: T.Dict[int, 'InternalDependency']) -> 'InternalDependency':
result = self.__class__.__new__(self.__class__)
assert isinstance(result, InternalDependency)