aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2017-09-21 11:48:30 -0400
committerLuke Shumaker <lukeshu@lukeshu.com>2017-09-21 11:59:03 -0400
commitbb25260f001c741d419f5732da4431a548b0749d (patch)
tree682f5892f36a3ba65f54b31d10acbf67f2904db1 /mesonbuild
parent751d59d95238e9f2ef12202df992d54650594919 (diff)
downloadmeson-bb25260f001c741d419f5732da4431a548b0749d.zip
meson-bb25260f001c741d419f5732da4431a548b0749d.tar.gz
meson-bb25260f001c741d419f5732da4431a548b0749d.tar.bz2
flake8: Perform suggested whitespace/formatting changes
This only touches newlines, spaces, and (occaisionally) commas. Anything else is left for another commit.
Diffstat (limited to 'mesonbuild')
-rw-r--r--mesonbuild/backend/ninjabackend.py31
-rw-r--r--mesonbuild/backend/vs2010backend.py6
-rw-r--r--mesonbuild/compilers/c.py2
-rw-r--r--mesonbuild/compilers/compilers.py2
-rw-r--r--mesonbuild/interpreter.py79
-rw-r--r--mesonbuild/mesonmain.py10
-rw-r--r--mesonbuild/modules/gnome.py22
-rw-r--r--mesonbuild/modules/i18n.py6
8 files changed, 81 insertions, 77 deletions
diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py
index aeb2411..cd2f053 100644
--- a/mesonbuild/backend/ninjabackend.py
+++ b/mesonbuild/backend/ninjabackend.py
@@ -83,10 +83,9 @@ class NinjaBuildElement:
def write(self, outfile):
self.check_outputs()
- line = 'build %s: %s %s' % (
- ' '.join([ninja_quote(i) for i in self.outfilenames]),
- self.rule,
- ' '.join([ninja_quote(i) for i in self.infilenames]))
+ line = 'build %s: %s %s' % (' '.join([ninja_quote(i) for i in self.outfilenames]),
+ self.rule,
+ ' '.join([ninja_quote(i) for i in self.infilenames]))
if len(self.deps) > 0:
line += ' | ' + ' '.join([ninja_quote(x) for x in self.deps])
if len(self.orderdeps) > 0:
@@ -721,8 +720,7 @@ int dummy;
# On toolchains/platforms that use an import library for
# linking (separate from the shared library with all the
# code), we need to install that too (dll.a/.lib).
- if (isinstance(t, build.SharedLibrary) or
- isinstance(t, build.Executable)) and t.get_import_filename():
+ if (isinstance(t, build.SharedLibrary) or isinstance(t, build.Executable)) and t.get_import_filename():
if custom_install_dir:
# If the DLL is installed into a custom directory,
# install the import library into the same place so
@@ -856,8 +854,9 @@ int dummy;
self.create_target_alias('meson-test', outfile)
# And then benchmarks.
- cmd = self.environment.get_build_command(True) + ['test', '--benchmark', '--logbase',
- 'benchmarklog', '--num-processes=1', '--no-rebuild']
+ cmd = self.environment.get_build_command(True) + [
+ 'test', '--benchmark', '--logbase',
+ 'benchmarklog', '--num-processes=1', '--no-rebuild']
elem = NinjaBuildElement(self.all_outputs, 'meson-benchmark', 'CUSTOM_COMMAND', ['all', 'PHONY'])
elem.add_item('COMMAND', cmd)
elem.add_item('DESC', 'Running benchmark suite.')
@@ -1576,9 +1575,10 @@ int dummy;
def generate_swift_compile_rules(self, compiler, outfile):
rule = 'rule %s_COMPILER\n' % compiler.get_language()
full_exe = [ninja_quote(x) for x in self.environment.get_build_command()] + [
- '--internal',
- 'dirchanger',
- '$RUNDIR']
+ '--internal',
+ 'dirchanger',
+ '$RUNDIR',
+ ]
invoc = (' '.join(full_exe) + ' ' +
' '.join(ninja_quote(i) for i in compiler.get_exelist()))
command = ' command = %s $ARGS $in\n' % invoc
@@ -2527,10 +2527,11 @@ rule FORTRAN_DEP_HACK
def generate_dist(self, outfile):
elem = NinjaBuildElement(self.all_outputs, 'meson-dist', 'CUSTOM_COMMAND', 'PHONY')
elem.add_item('DESC', 'Creating source packages')
- elem.add_item('COMMAND', self.environment.get_build_command() +
- ['--internal', 'dist',
- self.environment.source_dir,
- self.environment.build_dir] + self.environment.get_build_command())
+ elem.add_item('COMMAND', self.environment.get_build_command() + [
+ '--internal', 'dist',
+ self.environment.source_dir,
+ self.environment.build_dir,
+ ] + self.environment.get_build_command())
elem.add_item('pool', 'console')
elem.write(outfile)
# Alias that runs the target defined above
diff --git a/mesonbuild/backend/vs2010backend.py b/mesonbuild/backend/vs2010backend.py
index 0bbc17c..1c87b05 100644
--- a/mesonbuild/backend/vs2010backend.py
+++ b/mesonbuild/backend/vs2010backend.py
@@ -383,8 +383,7 @@ class Vs2010Backend(backends.Backend):
cmd = [sys.executable, os.path.join(self.environment.get_script_dir(), 'commandrunner.py'),
self.environment.get_build_dir(),
self.environment.get_source_dir(),
- self.get_target_dir(target)] + \
- self.environment.get_build_command()
+ self.get_target_dir(target)] + self.environment.get_build_command()
for i in cmd_raw:
if isinstance(i, build.BuildTarget):
cmd.append(os.path.join(self.environment.get_build_dir(), self.get_target_filename(i)))
@@ -926,8 +925,7 @@ class Vs2010Backend(backends.Backend):
ofile.text = '$(OutDir)%s' % target.get_filename()
subsys = ET.SubElement(link, 'SubSystem')
subsys.text = subsystem
- if (isinstance(target, build.SharedLibrary) or
- isinstance(target, build.Executable)) and target.get_import_filename():
+ if (isinstance(target, build.SharedLibrary) or isinstance(target, build.Executable)) and target.get_import_filename():
# DLLs built with MSVC always have an import library except when
# they're data-only DLLs, but we don't support those yet.
ET.SubElement(link, 'ImportLibrary').text = target.get_import_filename()
diff --git a/mesonbuild/compilers/c.py b/mesonbuild/compilers/c.py
index 255a506..98b2fbc 100644
--- a/mesonbuild/compilers/c.py
+++ b/mesonbuild/compilers/c.py
@@ -1025,5 +1025,3 @@ class VisualStudioCCompiler(CCompiler):
# and the can not be called.
return None
return vs32_instruction_set_args.get(instruction_set, None)
-
-
diff --git a/mesonbuild/compilers/compilers.py b/mesonbuild/compilers/compilers.py
index c431194..89208e0 100644
--- a/mesonbuild/compilers/compilers.py
+++ b/mesonbuild/compilers/compilers.py
@@ -252,7 +252,7 @@ vs32_instruction_set_args = {'mmx': ['/arch:SSE'], # There does not seem to be a
'avx': ['/arch:AVX'],
'avx2': ['/arch:AVX2'],
'neon': None,
-}
+ }
# The 64 bit compiler defaults to /arch:avx.
vs64_instruction_set_args = {'mmx': ['/arch:AVX'],
diff --git a/mesonbuild/interpreter.py b/mesonbuild/interpreter.py
index b28ca0e..51b8202 100644
--- a/mesonbuild/interpreter.py
+++ b/mesonbuild/interpreter.py
@@ -1028,7 +1028,6 @@ class CompilerHolder(InterpreterObject):
h)
return result
-
def first_supported_argument_method(self, args, kwargs):
for i in mesonlib.stringlistify(args):
if self.compiler.has_argument(i, self.environment):
@@ -1245,48 +1244,50 @@ class MesonMain(InterpreterObject):
pch_kwargs = set(['c_pch', 'cpp_pch'])
-lang_arg_kwargs = set(['c_args',
- 'cpp_args',
- 'd_args',
- 'd_import_dirs',
- 'd_unittest',
- 'd_module_versions',
- 'fortran_args',
- 'java_args',
- 'objc_args',
- 'objcpp_args',
- 'rust_args',
- 'vala_args',
- 'cs_args',
- ])
+lang_arg_kwargs = set([
+ 'c_args',
+ 'cpp_args',
+ 'd_args',
+ 'd_import_dirs',
+ 'd_unittest',
+ 'd_module_versions',
+ 'fortran_args',
+ 'java_args',
+ 'objc_args',
+ 'objcpp_args',
+ 'rust_args',
+ 'vala_args',
+ 'cs_args',
+])
vala_kwargs = set(['vala_header', 'vala_gir', 'vala_vapi'])
rust_kwargs = set(['rust_crate_type'])
cs_kwargs = set(['resources', 'cs_args'])
-buildtarget_kwargs = set(['build_by_default',
- 'build_rpath',
- 'dependencies',
- 'extra_files',
- 'gui_app',
- 'link_with',
- 'link_whole',
- 'link_args',
- 'link_depends',
- 'implicit_include_directories',
- 'include_directories',
- 'install',
- 'install_rpath',
- 'install_dir',
- 'name_prefix',
- 'name_suffix',
- 'native',
- 'objects',
- 'override_options',
- 'pic',
- 'sources',
- 'vs_module_defs',
- ])
+buildtarget_kwargs = set([
+ 'build_by_default',
+ 'build_rpath',
+ 'dependencies',
+ 'extra_files',
+ 'gui_app',
+ 'link_with',
+ 'link_whole',
+ 'link_args',
+ 'link_depends',
+ 'implicit_include_directories',
+ 'include_directories',
+ 'install',
+ 'install_rpath',
+ 'install_dir',
+ 'name_prefix',
+ 'name_suffix',
+ 'native',
+ 'objects',
+ 'override_options',
+ 'pic',
+ 'sources',
+ 'vs_module_defs',
+])
build_target_common_kwargs = (
buildtarget_kwargs |
@@ -2013,7 +2014,7 @@ class Interpreter(InterpreterBase):
if not isinstance(use_native, bool):
raise InvalidArguments('Argument to "native" must be a boolean.')
if not use_native:
- progobj = self.program_from_cross_file(args)
+ progobj = self.program_from_cross_file(args)
if progobj is None:
progobj = self.program_from_system(args)
if required and (progobj is None or not progobj.found()):
diff --git a/mesonbuild/mesonmain.py b/mesonbuild/mesonmain.py
index 1657ddd..45e6026 100644
--- a/mesonbuild/mesonmain.py
+++ b/mesonbuild/mesonmain.py
@@ -122,11 +122,11 @@ class MesonApp:
if os.path.exists(priv_dir):
if not handshake:
print('Directory already configured, exiting Meson. Just run your build command\n'
- '(e.g. ninja) and Meson will regenerate as necessary. If ninja fails, run ninja\n'
- 'reconfigure to force Meson to regenerate.\n'
- '\nIf build failures persist, manually wipe your build directory to clear any\n'
- 'stored system data.\n'
- '\nTo change option values, run meson configure instead.')
+ '(e.g. ninja) and Meson will regenerate as necessary. If ninja fails, run ninja\n'
+ 'reconfigure to force Meson to regenerate.\n'
+ '\nIf build failures persist, manually wipe your build directory to clear any\n'
+ 'stored system data.\n'
+ '\nTo change option values, run meson configure instead.')
sys.exit(0)
else:
if handshake:
diff --git a/mesonbuild/modules/gnome.py b/mesonbuild/modules/gnome.py
index 137d380..12d3f90 100644
--- a/mesonbuild/modules/gnome.py
+++ b/mesonbuild/modules/gnome.py
@@ -697,18 +697,22 @@ This will become a hard error in the future.''')
args.append('--langs=' + '@@'.join(langs))
inscript = build.RunScript(script, args)
- potargs = state.environment.get_build_command() + ['--internal', 'yelphelper', 'pot',
- '--subdir=' + state.subdir,
- '--id=' + project_id,
- '--sources=' + source_str]
+ potargs = state.environment.get_build_command() + [
+ '--internal', 'yelphelper', 'pot',
+ '--subdir=' + state.subdir,
+ '--id=' + project_id,
+ '--sources=' + source_str,
+ ]
pottarget = build.RunTarget('help-' + project_id + '-pot', potargs[0],
potargs[1:], [], state.subdir)
- poargs = state.environment.get_build_command() + ['--internal', 'yelphelper', 'update-po',
- '--subdir=' + state.subdir,
- '--id=' + project_id,
- '--sources=' + source_str,
- '--langs=' + '@@'.join(langs)]
+ poargs = state.environment.get_build_command() + [
+ '--internal', 'yelphelper', 'update-po',
+ '--subdir=' + state.subdir,
+ '--id=' + project_id,
+ '--sources=' + source_str,
+ '--langs=' + '@@'.join(langs),
+ ]
potarget = build.RunTarget('help-' + project_id + '-update-po', poargs[0],
poargs[1:], [], state.subdir)
diff --git a/mesonbuild/modules/i18n.py b/mesonbuild/modules/i18n.py
index 2af09de..76edb72 100644
--- a/mesonbuild/modules/i18n.py
+++ b/mesonbuild/modules/i18n.py
@@ -72,8 +72,10 @@ class I18nModule(ExtensionModule):
datadirs = self._get_data_dirs(state, mesonlib.stringlistify(kwargs.pop('data_dirs', [])))
datadirs = '--datadirs=' + ':'.join(datadirs) if datadirs else None
- command = state.environment.get_build_command() + ['--internal', 'msgfmthelper',
- '@INPUT@', '@OUTPUT@', file_type, podir]
+ command = state.environment.get_build_command() + [
+ '--internal', 'msgfmthelper',
+ '@INPUT@', '@OUTPUT@', file_type, podir
+ ]
if datadirs:
command.append(datadirs)