summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2025-04-22 07:16:27 +0200
committerDylan Baker <dylan@pnwbakers.com>2025-05-15 10:10:49 -0700
commit4cdff788e77403daeb1b7a91ee8a62d3783a7e8e (patch)
treeabf7683111500edb42b245afa18a9fb0da4c7e0c
parent68c55b86110dd333206ed974fcd1f3780a83a86c (diff)
downloadmeson-4cdff788e77403daeb1b7a91ee8a62d3783a7e8e.tar.gz
introspection: do not reinvent process_compiler_options
Let add_compiler_options and process_compiler_options handle subprojects, and also run it for the main project to ensure that pending_options are properly processed. This exposes a bug because "comp" could have been None, so fix that. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
-rw-r--r--mesonbuild/ast/introspection.py10
1 files changed, 2 insertions, 8 deletions
diff --git a/mesonbuild/ast/introspection.py b/mesonbuild/ast/introspection.py
index bb1e241e5..f63af8425 100644
--- a/mesonbuild/ast/introspection.py
+++ b/mesonbuild/ast/introspection.py
@@ -6,7 +6,6 @@
# or an interpreter-based tool
from __future__ import annotations
-import copy
import os
import typing as T
@@ -205,13 +204,8 @@ class IntrospectionInterpreter(AstInterpreter):
raise
else:
continue
- if self.subproject:
- options = {}
- for k in comp.get_options():
- v = copy.copy(self.coredata.optstore.get_value_object(k))
- k = k.evolve(subproject=self.subproject)
- options[k] = v
- self.coredata.add_compiler_options(options, lang, for_machine, self.environment, self.subproject)
+ if comp:
+ self.coredata.process_compiler_options(lang, comp, self.environment, self.subproject)
def func_dependency(self, node: BaseNode, args: T.List[TYPE_var], kwargs: T.Dict[str, TYPE_var]) -> None:
args = self.flatten_args(args)