diff options
author | Xavier Claessens <xavier.claessens@collabora.com> | 2022-03-22 21:20:15 -0400 |
---|---|---|
committer | Xavier Claessens <xclaesse@gmail.com> | 2022-03-29 16:10:28 -0400 |
commit | 90310116ab683f8b7869836b5ae9b6504f87bcf4 (patch) | |
tree | 3032c1385aa2865b6e8b53182da13ded444215e5 /mesonbuild/backend/xcodebackend.py | |
parent | e33ec88ac714b1d41cbfec28e80ee6bc046200eb (diff) | |
download | meson-90310116ab683f8b7869836b5ae9b6504f87bcf4.zip meson-90310116ab683f8b7869836b5ae9b6504f87bcf4.tar.gz meson-90310116ab683f8b7869836b5ae9b6504f87bcf4.tar.bz2 |
Replace backend.get_option_for_target() with target.get_option()
That method had nothing specific to the backend, it's purely a Target
method. This allows to cache the OptionOverrideProxy object on the
Target instance instead of creating a new one for each option lookup.
Diffstat (limited to 'mesonbuild/backend/xcodebackend.py')
-rw-r--r-- | mesonbuild/backend/xcodebackend.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/mesonbuild/backend/xcodebackend.py b/mesonbuild/backend/xcodebackend.py index 1cf1765..72667d7 100644 --- a/mesonbuild/backend/xcodebackend.py +++ b/mesonbuild/backend/xcodebackend.py @@ -1503,8 +1503,8 @@ class XCodeBackend(backends.Backend): if compiler is None: continue # Start with warning args - warn_args = compiler.get_warn_args(self.get_option_for_target(OptionKey('warning_level'), target)) - copt_proxy = self.get_options_for_target(target) + warn_args = compiler.get_warn_args(target.get_option(OptionKey('warning_level'))) + copt_proxy = target.get_options() std_args = compiler.get_option_compile_args(copt_proxy) # Add compile args added using add_project_arguments() pargs = self.build.projects_args[target.for_machine].get(target.subproject, {}).get(lang, []) @@ -1556,9 +1556,9 @@ class XCodeBackend(backends.Backend): if target.suffix: suffix = '.' + target.suffix settings_dict.add_item('EXECUTABLE_SUFFIX', suffix) - settings_dict.add_item('GCC_GENERATE_DEBUGGING_SYMBOLS', BOOL2XCODEBOOL[self.get_option_for_target(OptionKey('debug'), target)]) + settings_dict.add_item('GCC_GENERATE_DEBUGGING_SYMBOLS', BOOL2XCODEBOOL[target.get_option(OptionKey('debug'))]) settings_dict.add_item('GCC_INLINES_ARE_PRIVATE_EXTERN', 'NO') - settings_dict.add_item('GCC_OPTIMIZATION_LEVEL', OPT2XCODEOPT[self.get_option_for_target(OptionKey('optimization'), target)]) + settings_dict.add_item('GCC_OPTIMIZATION_LEVEL', OPT2XCODEOPT[target.get_option(OptionKey('optimization'))]) if target.has_pch: # Xcode uses GCC_PREFIX_HEADER which only allows one file per target/executable. Precompiling various header files and # applying a particular pch to each source file will require custom scripts (as a build phase) and build flags per each |