summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2022-01-13 10:07:02 -0800
committerEli Schwartz <eschwartz93@gmail.com>2023-12-20 14:15:45 -0500
commit67c51820b71d2f3db728b373383cb36daac7bb7a (patch)
tree759186d830ea732400799386b81e90b1cd98132e
parent0c3e84bbaf39a4b7f6dfd48faaee7adf61287b36 (diff)
downloadmeson-67c51820b71d2f3db728b373383cb36daac7bb7a.tar.gz
compilers: Add partial docstrings for a couple of Compiler methods
-rw-r--r--mesonbuild/compilers/compilers.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/mesonbuild/compilers/compilers.py b/mesonbuild/compilers/compilers.py
index 69e9f9386..cba530fd8 100644
--- a/mesonbuild/compilers/compilers.py
+++ b/mesonbuild/compilers/compilers.py
@@ -1,5 +1,6 @@
# SPDX-License-Identifier: Apache-2.0
# Copyright 2012-2022 The Meson development team
+# Copyright © 2023 Intel Corporation
from __future__ import annotations
@@ -784,11 +785,23 @@ class Compiler(HoldableObject, metaclass=abc.ABCMeta):
return []
def has_multi_arguments(self, args: T.List[str], env: 'Environment') -> T.Tuple[bool, bool]:
+ """Checks if the compiler has all of the arguments.
+
+ :returns:
+ A tuple of (bool, bool). The first value is whether the check
+ succeeded, and the second is whether it was retrieved from a cache
+ """
raise EnvironmentException(
'Language {} does not support has_multi_arguments.'.format(
self.get_display_language()))
def has_multi_link_arguments(self, args: T.List[str], env: 'Environment') -> T.Tuple[bool, bool]:
+ """Checks if the linker has all of the arguments.
+
+ :returns:
+ A tuple of (bool, bool). The first value is whether the check
+ succeeded, and the second is whether it was retrieved from a cache
+ """
return self.linker.has_multi_arguments(args, env)
def _get_compile_output(self, dirname: str, mode: CompileCheckMode) -> str:
@@ -1330,6 +1343,12 @@ class Compiler(HoldableObject, metaclass=abc.ABCMeta):
dependencies: T.Optional[T.List['Dependency']] = None,
mode: CompileCheckMode = CompileCheckMode.COMPILE,
disable_cache: bool = False) -> T.Tuple[bool, bool]:
+ """Run a compilation or link test to see if code can be compiled/linked.
+
+ :returns:
+ A tuple of (bool, bool). The first value is whether the check
+ succeeded, and the second is whether it was retrieved from a cache
+ """
with self._build_wrapper(code, env, extra_args, dependencies, mode, disable_cache=disable_cache) as p:
return p.returncode == 0, p.cached