diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2024-04-14 13:42:38 +0300 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2024-04-14 13:42:38 +0300 |
commit | 8a5dfed0268aa71d866015da00a68ff9a3938baa (patch) | |
tree | 3f99b725211f83fc34e875b8a70e775962d115d9 /mesonbuild/backend/vs2010backend.py | |
parent | 629abd6b95e131e2c7d70b2bec01d29e0917eefd (diff) | |
download | meson-optionrefactor.zip meson-optionrefactor.tar.gz meson-optionrefactor.tar.bz2 |
Refactor getting target options to a dedicated method.optionrefactor
Diffstat (limited to 'mesonbuild/backend/vs2010backend.py')
-rw-r--r-- | mesonbuild/backend/vs2010backend.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/mesonbuild/backend/vs2010backend.py b/mesonbuild/backend/vs2010backend.py index 20ad266..f4091db 100644 --- a/mesonbuild/backend/vs2010backend.py +++ b/mesonbuild/backend/vs2010backend.py @@ -1003,7 +1003,7 @@ class Vs2010Backend(backends.Backend): # Compile args added from the env or cross file: CFLAGS/CXXFLAGS, etc. We want these # to override all the defaults, but not the per-target compile args. for l in file_args.keys(): - file_args[l] += target.get_option(OptionKey('args', machine=target.for_machine, lang=l)) + file_args[l] += self.get_target_option(target, OptionKey('args', machine=target.for_machine, lang=l)) for args in file_args.values(): # This is where Visual Studio will insert target_args, target_defines, # etc, which are added later from external deps (see below). @@ -1293,7 +1293,7 @@ class Vs2010Backend(backends.Backend): if True in ((dep.name == 'openmp') for dep in target.get_external_deps()): ET.SubElement(clconf, 'OpenMPSupport').text = 'true' # CRT type; debug or release - vscrt_type = target.get_option(OptionKey('b_vscrt')) + vscrt_type = self.get_target_option(target, 'b_vscrt') vscrt_val = compiler.get_crt_val(vscrt_type, self.buildtype) if vscrt_val == 'mdd': ET.SubElement(type_config, 'UseDebugLibraries').text = 'true' @@ -1331,7 +1331,7 @@ class Vs2010Backend(backends.Backend): # Exception handling has to be set in the xml in addition to the "AdditionalOptions" because otherwise # cl will give warning D9025: overriding '/Ehs' with cpp_eh value if 'cpp' in target.compilers: - eh = target.get_option(OptionKey('eh', machine=target.for_machine, lang='cpp')) + eh = self.get_target_option(target, OptionKey('eh', machine=target.for_machine, lang='cpp')) if eh == 'a': ET.SubElement(clconf, 'ExceptionHandling').text = 'Async' elif eh == 's': @@ -1349,10 +1349,10 @@ class Vs2010Backend(backends.Backend): ET.SubElement(clconf, 'PreprocessorDefinitions').text = ';'.join(target_defines) ET.SubElement(clconf, 'FunctionLevelLinking').text = 'true' # Warning level - warning_level = T.cast('str', target.get_option(OptionKey('warning_level'))) + warning_level = T.cast('str', self.get_targetoption(target, 'warning_level')) warning_level = 'EnableAllWarnings' if warning_level == 'everything' else 'Level' + str(1 + int(warning_level)) ET.SubElement(clconf, 'WarningLevel').text = warning_level - if target.get_option(OptionKey('werror')): + if self.get_target_option(target, 'werror'): ET.SubElement(clconf, 'TreatWarningAsError').text = 'true' # Optimization flags o_flags = split_o_flags_args(build_args) @@ -1525,7 +1525,7 @@ class Vs2010Backend(backends.Backend): # /nologo ET.SubElement(link, 'SuppressStartupBanner').text = 'true' # /release - if not target.get_option(OptionKey('debug')): + if not self.get_target_option(target, 'debug'): ET.SubElement(link, 'SetChecksum').text = 'true' # Visual studio doesn't simply allow the src files of a project to be added with the 'Condition=...' attribute, |