From 57ce7d461877b2ad8da4f4712879880148759bc6 Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Fri, 21 Oct 2016 07:38:32 +0530 Subject: 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. --- mesonbuild/backend/ninjabackend.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'mesonbuild/backend/ninjabackend.py') 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) -- cgit v1.1