diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2017-03-13 14:13:21 -0400 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2017-04-15 18:28:36 +0300 |
commit | b48daeda1a53f0a1a218492e356186846a3abfff (patch) | |
tree | 66dd497fbd88c5c2991d19601058f4f8639c64b1 /mesonbuild/backend/backends.py | |
parent | 4e1249c920a6f64e2ca953334e9ec700f30693da (diff) | |
download | meson-b48daeda1a53f0a1a218492e356186846a3abfff.zip meson-b48daeda1a53f0a1a218492e356186846a3abfff.tar.gz meson-b48daeda1a53f0a1a218492e356186846a3abfff.tar.bz2 |
Make it possible to only do unity builds on subprojects.
Diffstat (limited to 'mesonbuild/backend/backends.py')
-rw-r--r-- | mesonbuild/backend/backends.py | 9 |
1 files changed, 8 insertions, 1 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, |