diff options
author | Nirbheek Chauhan <nirbheek@centricular.com> | 2016-10-21 07:38:32 +0530 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek@centricular.com> | 2016-10-21 08:00:39 +0530 |
commit | 57ce7d461877b2ad8da4f4712879880148759bc6 (patch) | |
tree | f6fcf145a32ad4f7cdc1022e5c441c5b91db9ddb /mesonbuild/backend/ninjabackend.py | |
parent | 9c9c5ab2a878a32c7f1e2855596caac1122b5bf5 (diff) | |
download | meson-57ce7d461877b2ad8da4f4712879880148759bc6.zip meson-57ce7d461877b2ad8da4f4712879880148759bc6.tar.gz meson-57ce7d461877b2ad8da4f4712879880148759bc6.tar.bz2 |
Add support for extracting objects in unity builds
Not only does extract_all_objects() now work properly again,
extract_objects() also works if you specify a subset of sources all of
which have been compiled into a single unified object.
So, for instance, this allows you to extract all the objects
corresponding to the C sources compiled into a target consisting of
C and C++ sources.
Diffstat (limited to 'mesonbuild/backend/ninjabackend.py')
-rw-r--r-- | mesonbuild/backend/ninjabackend.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py index 1f9357b..4ed062c 100644 --- a/mesonbuild/backend/ninjabackend.py +++ b/mesonbuild/backend/ninjabackend.py @@ -18,7 +18,7 @@ from .. import build from .. import mlog from .. import dependencies from .. import compilers -from ..mesonlib import File, MesonException +from ..mesonlib import File, MesonException, get_compiler_for_source from .backends import InstallData from ..build import InvalidArguments import os, sys, pickle, re @@ -1684,7 +1684,7 @@ rule FORTRAN_DEP_HACK if isinstance(src, RawFilename) and src.fname.endswith('.h'): raise AssertionError('BUG: sources should not contain headers') extra_orderdeps = [] - compiler = self.get_compiler_for_source(src, target.is_cross) + compiler = get_compiler_for_source(target.compilers.values(), src) commands = [] # The first thing is implicit include directories: source, build and private. commands += compiler.get_include_args(self.get_target_private_dir(target), False) @@ -1867,7 +1867,7 @@ rule FORTRAN_DEP_HACK 'directory as source, please put it in a subdirectory.' \ ''.format(target.get_basename()) raise InvalidArguments(msg) - compiler = self.get_compiler_for_lang(lang) + compiler = target.compilers[lang] if compiler.id == 'msvc': src = os.path.join(self.build_to_src, target.get_source_subdir(), pch[-1]) (commands, dep, dst, objs) = self.generate_msvc_pch_command(target, compiler, pch) |