diff options
| -rw-r--r-- | mesonbuild/build.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/mesonbuild/build.py b/mesonbuild/build.py index c72857d2c..82d97fd2d 100644 --- a/mesonbuild/build.py +++ b/mesonbuild/build.py @@ -49,6 +49,7 @@ if T.TYPE_CHECKING: from .mesonlib import ExecutableSerialisation, FileMode, FileOrString from .modules import ModuleState from .mparser import BaseNode + from .options import ElementaryOptionValues GeneratedTypes = T.Union['CustomTarget', 'CustomTargetIndex', 'GeneratedList'] LibTypes = T.Union['SharedLibrary', 'StaticLibrary', 'CustomTarget', 'CustomTargetIndex'] @@ -679,10 +680,8 @@ class Target(HoldableObject, metaclass=abc.ABCMeta): def get_options(self) -> coredata.OptionsView: return self.options - def get_option(self, key: 'OptionKey') -> T.Union[str, int, bool]: - # TODO: if it's possible to annotate get_option or validate_option_value - # in the future we might be able to remove the cast here - return T.cast('T.Union[str, int, bool]', self.options.get_value(key)) + def get_option(self, key: OptionKey) -> ElementaryOptionValues: + return self.options.get_value(key) @staticmethod def parse_overrides(kwargs: T.Dict[str, T.Any]) -> T.Dict[OptionKey, str]: |
