diff options
author | Eli Schwartz <eschwartz@archlinux.org> | 2022-06-21 16:42:06 -0400 |
---|---|---|
committer | Eli Schwartz <eschwartz@archlinux.org> | 2022-06-21 16:42:06 -0400 |
commit | b05d7db44359c4e5bf7816d68e8bb556fd1e4724 (patch) | |
tree | 5cd5e8ddf84edd3714218f07968745d22383a1a7 /mesonbuild/interpreter | |
parent | a20523aa5f8ee8152f42a158226b1b3112a26521 (diff) | |
download | meson-b05d7db44359c4e5bf7816d68e8bb556fd1e4724.zip meson-b05d7db44359c4e5bf7816d68e8bb556fd1e4724.tar.gz meson-b05d7db44359c4e5bf7816d68e8bb556fd1e4724.tar.bz2 |
fix type checking for declare_dependency to allow linking to executable
We have to handle this, because Windows needs to link to the implib of
the executable (???) in order to create a shared module. This is
explicitly checked for and handled in the backend, and creating a build
target with `link_with: some_exe` still works, even. But updating
declare_dependency to typed_kwargs neglected to take that into account,
so creating a convenience interface for those same arguments failed.
Diffstat (limited to 'mesonbuild/interpreter')
-rw-r--r-- | mesonbuild/interpreter/type_checking.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/mesonbuild/interpreter/type_checking.py b/mesonbuild/interpreter/type_checking.py index 636fd96..e0ddb1b 100644 --- a/mesonbuild/interpreter/type_checking.py +++ b/mesonbuild/interpreter/type_checking.py @@ -10,7 +10,7 @@ import typing as T from .. import compilers from ..build import (EnvironmentVariables, EnvInitValueType, CustomTarget, BuildTarget, CustomTargetIndex, ExtractedObjects, GeneratedList, IncludeDirs, - BothLibraries, SharedLibrary, StaticLibrary, Jar) + BothLibraries, SharedLibrary, StaticLibrary, Jar, Executable) from ..coredata import UserFeatureOption from ..dependencies import Dependency, InternalDependency from ..interpreterbase.decorators import KwargInfo, ContainerTypeInfo @@ -400,9 +400,9 @@ D_MODULE_VERSIONS_KW: KwargInfo[T.List[T.Union[str, int]]] = KwargInfo( _link_with_error = '''can only be self-built targets, external dependencies (including libraries) must go in "dependencies".''' # Allow Dependency for the better error message? But then in other cases it will list this as one of the allowed types! -LINK_WITH_KW: KwargInfo[T.List[T.Union[BothLibraries, SharedLibrary, StaticLibrary, CustomTarget, CustomTargetIndex, Jar]]] = KwargInfo( +LINK_WITH_KW: KwargInfo[T.List[T.Union[BothLibraries, SharedLibrary, StaticLibrary, CustomTarget, CustomTargetIndex, Jar, Executable]]] = KwargInfo( 'link_with', - ContainerTypeInfo(list, (BothLibraries, SharedLibrary, StaticLibrary, CustomTarget, CustomTargetIndex, Jar, Dependency)), + ContainerTypeInfo(list, (BothLibraries, SharedLibrary, StaticLibrary, CustomTarget, CustomTargetIndex, Jar, Executable, Dependency)), listify=True, default=[], validator=lambda x: _link_with_error if isinstance(x, Dependency) else None, |