diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2017-03-12 20:05:21 +0200 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2017-04-02 00:07:23 +0300 |
commit | cf97c7af813ef39a7edf0693a4b127d30ad9cc55 (patch) | |
tree | 8771bbbe6f78292ffb954c974e2cdff9fea5473e /mesonbuild/backend/backends.py | |
parent | 294abe244f100272f358b7f52813554399c44023 (diff) | |
download | meson-cf97c7af813ef39a7edf0693a4b127d30ad9cc55.zip meson-cf97c7af813ef39a7edf0693a4b127d30ad9cc55.tar.gz meson-cf97c7af813ef39a7edf0693a4b127d30ad9cc55.tar.bz2 |
Use get_option_for_target for builtins where sensible.
Diffstat (limited to 'mesonbuild/backend/backends.py')
-rw-r--r-- | mesonbuild/backend/backends.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/mesonbuild/backend/backends.py b/mesonbuild/backend/backends.py index eaef7d3..93a75ec 100644 --- a/mesonbuild/backend/backends.py +++ b/mesonbuild/backend/backends.py @@ -107,7 +107,7 @@ class Backend: if option_name in target.option_overrides: override = target.option_overrides[option_name] return self.environment.coredata.validate_option_value(option_name, override) - return self.environment.coredata.get_builtin_option('unity') + return self.environment.coredata.get_builtin_option(option_name) def get_target_filename_for_linking(self, target): # On some platforms (msvc for instance), the file that is used for @@ -194,7 +194,7 @@ class Backend: elif isinstance(obj, mesonlib.File): obj_list.append(obj.rel_to_builddir(self.build_to_src)) elif isinstance(obj, build.ExtractedObjects): - obj_list += self.determine_ext_objs(obj, proj_dir_to_build_root) + obj_list += self.determine_ext_objs(target, obj, proj_dir_to_build_root) else: raise MesonException('Unknown data type in object list.') return obj_list @@ -279,13 +279,13 @@ class Backend: source = os.path.join(self.get_target_private_dir(target), source[:-5] + '.c') return source.replace('/', '_').replace('\\', '_') + '.' + self.environment.get_object_suffix() - def determine_ext_objs(self, extobj, proj_dir_to_build_root): + def determine_ext_objs(self, target, extobj, proj_dir_to_build_root): result = [] targetdir = self.get_target_private_dir(extobj.target) # 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.environment.coredata.get_builtin_option('unity'): + if self.get_option_for_target('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 @@ -358,19 +358,19 @@ class Backend: # we weren't explicitly asked to not emit warnings (for Vala, f.ex) if no_warn_args: commands += compiler.get_no_warn_args() - elif self.environment.coredata.get_builtin_option('buildtype') != 'plain': - commands += compiler.get_warn_args(self.environment.coredata.get_builtin_option('warning_level')) + elif self.get_option_for_target('buildtype', target) != 'plain': + commands += compiler.get_warn_args(self.get_option_for_target('warning_level', target)) # Add -Werror if werror=true is set in the build options set on the # command-line or default_options inside project(). This only sets the # action to be done for warnings if/when they are emitted, so it's ok # to set it after get_no_warn_args() or get_warn_args(). - if self.environment.coredata.get_builtin_option('werror'): + if self.get_option_for_target('werror', target): commands += compiler.get_werror_args() # Add compile args for c_* or cpp_* build options set on the # command-line or default_options inside project(). commands += compiler.get_option_compile_args(self.environment.coredata.compiler_options) # Add buildtype args: optimization level, debugging, etc. - commands += compiler.get_buildtype_args(self.environment.coredata.get_builtin_option('buildtype')) + commands += compiler.get_buildtype_args(self.get_option_for_target('buildtype', target)) # Add compile args added using add_project_arguments() commands += self.build.get_project_args(compiler, target.subproject) # Add compile args added using add_global_arguments() |