summaryrefslogtreecommitdiff
path: root/mesonbuild/compilers/compilers.py
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2025-11-13 11:38:08 -0800
committerDylan Baker <dylan@pnwbakers.com>2025-11-19 10:48:48 -0800
commit64535bbc821c0276ffe8c894502067a14229e10b (patch)
tree5c6c7902158ff3dc9d8dbb889275faa867297615 /mesonbuild/compilers/compilers.py
parent299136511e224676b29a2406349b32d86d4f2dd9 (diff)
downloadmeson-64535bbc821c0276ffe8c894502067a14229e10b.tar.gz
compilers/rust: make use the fact we have an Environment to cleanup
This adds a second stage initialization, which allows us to use options for setting attributes on the compiler. This is called during the detect phase, so the Compiler is never used in a partially initialized state.
Diffstat (limited to 'mesonbuild/compilers/compilers.py')
-rw-r--r--mesonbuild/compilers/compilers.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/mesonbuild/compilers/compilers.py b/mesonbuild/compilers/compilers.py
index 6b6dade7d..c09f5057a 100644
--- a/mesonbuild/compilers/compilers.py
+++ b/mesonbuild/compilers/compilers.py
@@ -496,6 +496,9 @@ class Compiler(HoldableObject, metaclass=abc.ABCMeta):
# see :class:`Interpreter._redetect_machines()`
return self.environment.machines[self.for_machine]
+ def init_from_options(self) -> None:
+ """Initializer compiler attributes that require options to be set."""
+
def __repr__(self) -> str:
repr_str = "<{0}: v{1} `{2}`>"
return repr_str.format(self.__class__.__name__, self.version,