diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2016-12-21 00:09:44 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-12-21 00:09:44 +0200 |
commit | a2528a881640913dfc71fab7f15225d7e7d9a567 (patch) | |
tree | d4c90f6ae3a87624a4a7d7e90e48e2e700ee1d3f /mesonbuild/backend | |
parent | 39ab311019aed50c6baf3dcb2e1c1bfe0bbe15e8 (diff) | |
parent | 139e020ede8a954a276e69d5c1921884ef9725ce (diff) | |
download | meson-a2528a881640913dfc71fab7f15225d7e7d9a567.zip meson-a2528a881640913dfc71fab7f15225d7e7d9a567.tar.gz meson-a2528a881640913dfc71fab7f15225d7e7d9a567.tar.bz2 |
Merge pull request #1233 from mesonbuild/wip/ignatenko/code-style
Trivial cleanups in code
Diffstat (limited to 'mesonbuild/backend')
-rw-r--r-- | mesonbuild/backend/backends.py | 4 | ||||
-rw-r--r-- | mesonbuild/backend/ninjabackend.py | 7 | ||||
-rw-r--r-- | mesonbuild/backend/vs2010backend.py | 6 |
3 files changed, 6 insertions, 11 deletions
diff --git a/mesonbuild/backend/backends.py b/mesonbuild/backend/backends.py index b265a24..dc39ce4 100644 --- a/mesonbuild/backend/backends.py +++ b/mesonbuild/backend/backends.py @@ -170,7 +170,6 @@ class Backend(): # For each language, generate a unity source file and return the list for comp, srcs in compsrcs.items(): - lang = comp.get_language() with init_language_file(comp.get_default_suffix()) as ofile: for src in srcs: ofile.write('#include<%s>\n' % src) @@ -655,7 +654,7 @@ class Backend(): # Subprojects of subprojects may cause the same dep args to be used # multiple times. Remove duplicates here. Note that we can't dedup - # libraries based on name alone, because "-lfoo -lbar -lfoo" is + # libraries based on name alone, because "-lfoo -lbar -lfoo" is # a completely valid (though pathological) sequence and removing the # latter may fail. Usually only applies to static libs, though. def dedup_arguments(self, commands): @@ -672,4 +671,3 @@ class Backend(): previous = c final_commands.append(c) return final_commands - diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py index 4c10e8d..40776a9 100644 --- a/mesonbuild/backend/ninjabackend.py +++ b/mesonbuild/backend/ninjabackend.py @@ -268,7 +268,7 @@ int dummy; return False suffix = os.path.splitext(source)[1][1:] for lang in self.langs_cant_unity: - if not lang in target.compilers: + if lang not in target.compilers: continue if suffix in target.compilers[lang].file_suffixes: return False @@ -433,7 +433,7 @@ int dummy; def process_target_dependencies(self, target, outfile): for t in target.get_dependencies(): tname = t.get_basename() + t.type_suffix() - if not tname in self.processed_targets: + if tname not in self.processed_targets: self.generate_target(t, outfile) def custom_target_generator_inputs(self, target, outfile): @@ -1283,7 +1283,6 @@ int dummy; outfile.write(command) outfile.write(description) outfile.write('\n') - scriptdir = self.environment.get_script_dir() outfile.write('\n') symrule = 'rule SHSYM\n' symcmd = ' command = "%s" "%s" %s %s %s %s $CROSS\n' % (ninja_quote(sys.executable), @@ -2077,7 +2076,7 @@ rule FORTRAN_DEP_HACK result = [] for ld in link_deps: prospective = self.get_target_dir(ld) - if not prospective in result: + if prospective not in result: result.append(prospective) return result diff --git a/mesonbuild/backend/vs2010backend.py b/mesonbuild/backend/vs2010backend.py index f3e9b4f..3ba63f4 100644 --- a/mesonbuild/backend/vs2010backend.py +++ b/mesonbuild/backend/vs2010backend.py @@ -14,7 +14,6 @@ import os, sys import pickle -import re import xml.dom.minidom import xml.etree.ElementTree as ET @@ -259,7 +258,7 @@ class Vs2010Backend(backends.Backend): ofile.write('\tEndGlobalSection\n') ofile.write('\tGlobalSection(ProjectConfigurationPlatforms) = ' 'postSolution\n') - ofile.write('\t\t{%s}.%s|%s.ActiveCfg = %s|%s\n' % + ofile.write('\t\t{%s}.%s|%s.ActiveCfg = %s|%s\n' % (self.environment.coredata.regen_guid, self.buildtype, self.platform, self.buildtype, self.platform)) ofile.write('\t\t{%s}.%s|%s.Build.0 = %s|%s\n' % @@ -734,7 +733,6 @@ class Vs2010Backend(backends.Backend): if len(target_args) > 0: target_args.append('%(AdditionalOptions)') ET.SubElement(clconf, "AdditionalOptions").text = ' '.join(target_args) - additional_options_set = True for d in target.include_dirs: for i in d.incdirs: @@ -930,7 +928,7 @@ class Vs2010Backend(backends.Backend): 'ToolsVersion' : '4.0', 'xmlns' : 'http://schemas.microsoft.com/developer/msbuild/2003'}) confitems = ET.SubElement(root, 'ItemGroup', {'Label' : 'ProjectConfigurations'}) - prjconf = ET.SubElement(confitems, 'ProjectConfiguration', + prjconf = ET.SubElement(confitems, 'ProjectConfiguration', {'Include' : self.buildtype + '|' + self.platform}) p = ET.SubElement(prjconf, 'Configuration') p.text= self.buildtype |