summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2025-05-19 11:39:15 -0700
committerEli Schwartz <eschwartz93@gmail.com>2025-06-05 16:24:00 -0400
commita7a228fa74d27328575863b295fff1773e96abdb (patch)
treebd56e24251ec4aa14c56dc4d2032c441a79a0754
parent78efb1c2d0d1221eada5aa9966f5a8aa95b56134 (diff)
downloadmeson-a7a228fa74d27328575863b295fff1773e96abdb.tar.gz
build: Fix tasking compiler b_lto detection for overrides
Actually take an override into account, ie: ```meson library( ... override_options : {'b_lto' : false}, ) ```
-rw-r--r--mesonbuild/build.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/mesonbuild/build.py b/mesonbuild/build.py
index a7dfc890c..7ebf3050d 100644
--- a/mesonbuild/build.py
+++ b/mesonbuild/build.py
@@ -2183,7 +2183,13 @@ class StaticLibrary(BuildTarget):
else:
self.suffix = 'a'
if 'c' in self.compilers and self.compilers['c'].get_id() == 'tasking' and not self.prelink:
- if self.environment.coredata.optstore.get_value_for(OptionKey('b_lto'), self.subproject):
+ key = OptionKey('b_lto', self.subproject, self.for_machine)
+ try:
+ v = self.environment.coredata.get_option_for_target(self, key)
+ except KeyError:
+ v = self.environment.coredata.optstore.get_value_for(key)
+ assert isinstance(v, bool), 'for mypy'
+ if v:
self.suffix = 'ma'
self.filename = self.prefix + self.name + '.' + self.suffix
self.outputs[0] = self.filename