diff options
Diffstat (limited to 'mesonbuild')
-rw-r--r-- | mesonbuild/build.py | 6 | ||||
-rw-r--r-- | mesonbuild/interpreter/kwargs.py | 4 | ||||
-rw-r--r-- | mesonbuild/interpreter/type_checking.py | 5 |
3 files changed, 8 insertions, 7 deletions
diff --git a/mesonbuild/build.py b/mesonbuild/build.py index 7b5cfa7..10f2261 100644 --- a/mesonbuild/build.py +++ b/mesonbuild/build.py @@ -2331,13 +2331,13 @@ class SharedLibrary(BuildTarget): elif isinstance(path, File): # When passing a generated file. self.vs_module_defs = path - elif isinstance(path, CustomTarget): + elif isinstance(path, (CustomTarget, CustomTargetIndex)): # When passing output of a Custom Target - self.vs_module_defs = File.from_built_file(path.subdir, path.get_filename()) + self.vs_module_defs = File.from_built_file(path.get_subdir(), path.get_filename()) else: raise InvalidArguments( 'Shared library vs_module_defs must be either a string, ' - 'a file object or a Custom Target') + 'a file object, a Custom Target, or a Custom Target Index') self.process_link_depends(path) rust_abi = kwargs.get('rust_abi') diff --git a/mesonbuild/interpreter/kwargs.py b/mesonbuild/interpreter/kwargs.py index ba5b5d0..cbe4405 100644 --- a/mesonbuild/interpreter/kwargs.py +++ b/mesonbuild/interpreter/kwargs.py @@ -359,7 +359,7 @@ class _SharedLibMixin(TypedDict): darwin_versions: T.Optional[T.Tuple[str, str]] soversion: T.Optional[str] version: T.Optional[str] - vs_module_defs: T.Optional[T.Union[str, File, build.CustomTarget]] + vs_module_defs: T.Optional[T.Union[str, File, build.CustomTarget, build.CustomTargetIndex]] class SharedLibrary(_BuildTarget, _SharedLibMixin, _LibraryMixin): @@ -368,7 +368,7 @@ class SharedLibrary(_BuildTarget, _SharedLibMixin, _LibraryMixin): class SharedModule(_BuildTarget, _LibraryMixin): - vs_module_defs: T.Optional[T.Union[str, File, build.CustomTarget]] + vs_module_defs: T.Optional[T.Union[str, File, build.CustomTarget, build.CustomTargetIndex]] class Library(_BuildTarget, _SharedLibMixin, _StaticLibMixin, _LibraryMixin): diff --git a/mesonbuild/interpreter/type_checking.py b/mesonbuild/interpreter/type_checking.py index 8f5fd08..0d0267d 100644 --- a/mesonbuild/interpreter/type_checking.py +++ b/mesonbuild/interpreter/type_checking.py @@ -513,9 +513,10 @@ RUST_ABI_KW: KwargInfo[T.Union[str, None]] = KwargInfo( since='1.3.0', validator=in_set_validator({'rust', 'c'})) -_VS_MODULE_DEFS_KW: KwargInfo[T.Optional[T.Union[str, File, CustomTarget]]] = KwargInfo( +_VS_MODULE_DEFS_KW: KwargInfo[T.Optional[T.Union[str, File, CustomTarget, CustomTargetIndex]]] = KwargInfo( 'vs_module_defs', - (str, File, CustomTarget, NoneType), + (str, File, CustomTarget, CustomTargetIndex, NoneType), + since_values={CustomTargetIndex: '1.3.0'} ) # Applies to all build_target like classes |