Skip to content

Commit

Permalink
compilers: Add docstring for Compiler.get_define
Browse files Browse the repository at this point in the history
  • Loading branch information
dcbaker committed Sep 13, 2024
1 parent 27fefaa commit 497d019
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions mesonbuild/compilers/compilers.py
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,19 @@ def get_define(self, dname: str, prefix: str, env: 'Environment',
extra_args: T.Union[T.List[str], T.Callable[[CompileCheckMode], T.List[str]]],
dependencies: T.List['Dependency'],
disable_cache: bool = False) -> CompileCheckResult[T.Optional[str]]:
"""Get the value of a given pre-processor define.
This is only used by languages that use a pre-processor, like the C family.
:param dname: The type whose members will be checked
:param prefix: A preamble to add to the top of the generated test code
:param env: The Meson Environment
:param extra_args: Any extra arguments to pass to the check, defaults to None
:param dependencies: A list of Meson Dependency objects, defaults to None
:param disable_cache: Skip the cache. Default: False
:raises EnvironmentException: If the given compiler does not implement this check
:return: a :class:`CompileCheckResult[str | None]`
"""
raise EnvironmentException('%s does not support get_define ' % self.get_id())

def compute_int(self, expression: str, low: T.Optional[int], high: T.Optional[int],
Expand Down

0 comments on commit 497d019

Please sign in to comment.