aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/backend/backends.py
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2022-05-23 16:21:39 +0200
committerDylan Baker <dylan@pnwbakers.com>2022-06-14 10:11:22 -0700
commitdae986073d5ab3a6241cecaf3362065256400772 (patch)
tree3b842cc17520a2c723e16238a3ddeedf2d9250e3 /mesonbuild/backend/backends.py
parentf3ba24f2892fa4ccf1c6c198190f43d4da44a761 (diff)
downloadmeson-dae986073d5ab3a6241cecaf3362065256400772.zip
meson-dae986073d5ab3a6241cecaf3362065256400772.tar.gz
meson-dae986073d5ab3a6241cecaf3362065256400772.tar.bz2
take override_option('unity=...') into account when allowing extract_objects()
A single target could be picked for unity build, and in that case extract_objects() should not be allowed. Likewise for the opposite case, where extract_objects() should be allowed if unity build is disabled for a single target. A test that covers that case is added later.
Diffstat (limited to 'mesonbuild/backend/backends.py')
-rw-r--r--mesonbuild/backend/backends.py6
1 files changed, 1 insertions, 5 deletions
diff --git a/mesonbuild/backend/backends.py b/mesonbuild/backend/backends.py
index 8524bf9..fb4163f 100644
--- a/mesonbuild/backend/backends.py
+++ b/mesonbuild/backend/backends.py
@@ -836,7 +836,7 @@ class Backend:
# With unity builds, sources don't map directly to objects,
# we only support extracting all the objects in this mode,
# so just return all object files.
- if self.is_unity(extobj.target):
+ if extobj.target.is_unity:
compsrcs = classify_unity_sources(extobj.target.compilers.values(), sources)
sources = []
unity_size = extobj.target.get_option(OptionKey('unity_size'))
@@ -1280,10 +1280,6 @@ class Backend:
libs.extend(self.get_custom_target_provided_by_generated_source(t))
return libs
- def is_unity(self, target: build.BuildTarget) -> bool:
- optval = target.get_option(OptionKey('unity'))
- return optval == 'on' or (optval == 'subprojects' and target.subproject != '')
-
def get_custom_target_sources(self, target: build.CustomTarget) -> T.List[str]:
'''
Custom target sources can be of various object types; strings, File,