aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/backend
diff options
context:
space:
mode:
Diffstat (limited to 'mesonbuild/backend')
-rw-r--r--mesonbuild/backend/backends.py9
-rw-r--r--mesonbuild/backend/ninjabackend.py2
-rw-r--r--mesonbuild/backend/vs2010backend.py2
3 files changed, 10 insertions, 3 deletions
diff --git a/mesonbuild/backend/backends.py b/mesonbuild/backend/backends.py
index a77047b..6a00d17 100644
--- a/mesonbuild/backend/backends.py
+++ b/mesonbuild/backend/backends.py
@@ -306,7 +306,7 @@ class Backend:
# With unity builds, there's just one object that contains all the
# sources, and we only support extracting all the objects in this mode,
# so just return that.
- if self.get_option_for_target('unity', target):
+ if self.is_unity(target):
comp = get_compiler_for_source(extobj.target.compilers.values(),
extobj.srclist[0])
# There is a potential conflict here, but it is unlikely that
@@ -607,6 +607,13 @@ class Backend:
libs.append(os.path.join(self.get_target_dir(t), f))
return libs
+ def is_unity(self, target):
+ optval = self.get_option_for_target('unity', target)
+ if optval == 'on' or (optval == 'subprojects' and target.subproject != ''):
+ return True
+ return False
+
+
def get_custom_target_sources(self, target):
'''
Custom target sources can be of various object types; strings, File,
diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py
index dc05d34..fa7b9c0 100644
--- a/mesonbuild/backend/ninjabackend.py
+++ b/mesonbuild/backend/ninjabackend.py
@@ -343,7 +343,7 @@ int dummy;
outname = self.get_target_filename(target)
obj_list = []
use_pch = self.environment.coredata.base_options.get('b_pch', False)
- is_unity = self.get_option_for_target('unity', target)
+ is_unity = self.is_unity(target)
if use_pch and target.has_pch():
pch_objects = self.generate_pch(target, outfile)
else:
diff --git a/mesonbuild/backend/vs2010backend.py b/mesonbuild/backend/vs2010backend.py
index 9937521..432bdd0 100644
--- a/mesonbuild/backend/vs2010backend.py
+++ b/mesonbuild/backend/vs2010backend.py
@@ -614,7 +614,7 @@ class Vs2010Backend(backends.Backend):
# Prefix to use to access the source tree's subdir from the vcxproj dir
proj_to_src_dir = os.path.join(proj_to_src_root, target.subdir)
(sources, headers, objects, languages) = self.split_sources(target.sources)
- if self.get_option_for_target('unity', target):
+ if self.is_unity(target):
sources = self.generate_unity_files(target, sources)
compiler = self._get_cl_compiler(target)
buildtype_args = compiler.get_buildtype_args(self.buildtype)