diff options
| -rw-r--r-- | mesonbuild/build.py | 2 | ||||
| -rw-r--r-- | mesonbuild/interpreter/kwargs.py | 4 | ||||
| -rw-r--r-- | mesonbuild/interpreter/type_checking.py | 8 |
3 files changed, 12 insertions, 2 deletions
diff --git a/mesonbuild/build.py b/mesonbuild/build.py index 4152be778..7b5cfa786 100644 --- a/mesonbuild/build.py +++ b/mesonbuild/build.py @@ -2321,7 +2321,7 @@ class SharedLibrary(BuildTarget): self.darwin_versions = (self.soversion, self.soversion) # Visual Studio module-definitions file - if 'vs_module_defs' in kwargs: + if kwargs.get('vs_module_defs') is not None: path = kwargs['vs_module_defs'] if isinstance(path, str): if os.path.isabs(path): diff --git a/mesonbuild/interpreter/kwargs.py b/mesonbuild/interpreter/kwargs.py index bf0c64cc9..ba5b5d0cc 100644 --- a/mesonbuild/interpreter/kwargs.py +++ b/mesonbuild/interpreter/kwargs.py @@ -359,6 +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]] class SharedLibrary(_BuildTarget, _SharedLibMixin, _LibraryMixin): @@ -366,7 +367,8 @@ class SharedLibrary(_BuildTarget, _SharedLibMixin, _LibraryMixin): class SharedModule(_BuildTarget, _LibraryMixin): - pass + + vs_module_defs: T.Optional[T.Union[str, File, build.CustomTarget]] class Library(_BuildTarget, _SharedLibMixin, _StaticLibMixin, _LibraryMixin): diff --git a/mesonbuild/interpreter/type_checking.py b/mesonbuild/interpreter/type_checking.py index 286bdcab3..8f5fd0848 100644 --- a/mesonbuild/interpreter/type_checking.py +++ b/mesonbuild/interpreter/type_checking.py @@ -513,6 +513,11 @@ 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', + (str, File, CustomTarget, NoneType), +) + # Applies to all build_target like classes _ALL_TARGET_KWS: T.List[KwargInfo] = [ OVERRIDE_OPTIONS_KW, @@ -629,6 +634,7 @@ SHARED_LIB_KWS = [ *_BUILD_TARGET_KWS, *_EXCLUSIVE_SHARED_LIB_KWS, *_EXCLUSIVE_LIB_KWS, + _VS_MODULE_DEFS_KW, ] # Arguments exclusive to SharedModule. These are separated to make integrating @@ -640,6 +646,7 @@ SHARED_MOD_KWS = [ *_BUILD_TARGET_KWS, *_EXCLUSIVE_SHARED_MOD_KWS, *_EXCLUSIVE_LIB_KWS, + _VS_MODULE_DEFS_KW, ] # Arguments exclusive to JAR. These are separated to make integrating @@ -662,6 +669,7 @@ LIBRARY_KWS = [ *_EXCLUSIVE_SHARED_LIB_KWS, *_EXCLUSIVE_SHARED_MOD_KWS, *_EXCLUSIVE_STATIC_LIB_KWS, + _VS_MODULE_DEFS_KW, ] # Arguments used by build_Target |
