aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mesonbuild/backend/ninjabackend.py10
-rw-r--r--mesonbuild/build.py6
-rw-r--r--mesonbuild/compilers.py9
-rw-r--r--mesonbuild/coredata.py48
-rw-r--r--mesonbuild/dependencies.py8
-rw-r--r--mesonbuild/environment.py2
-rw-r--r--mesonbuild/interpreter.py4
-rw-r--r--mesonbuild/mparser.py6
-rw-r--r--mesonbuild/scripts/__init__.py4
-rwxr-xr-xmesontest.py4
-rwxr-xr-xtools/cmake2meson.py5
11 files changed, 55 insertions, 51 deletions
diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py
index 9566c2f..e6f82d1 100644
--- a/mesonbuild/backend/ninjabackend.py
+++ b/mesonbuild/backend/ninjabackend.py
@@ -317,7 +317,7 @@ int dummy;
# Sources consumed by valac are filtered out. These only contain
# C/C++ sources, objects, generated libs, and unknown sources now.
target_sources, generated_sources, \
- vala_generated_sources = self.generate_vala_compile(target, outfile)
+ vala_generated_sources = self.generate_vala_compile(target, outfile)
else:
target_sources = self.get_target_sources(target)
generated_sources = self.get_target_generated_sources(target)
@@ -1257,8 +1257,10 @@ int dummy;
ctypes.append((self.build.cross_compilers, True))
for (complist, is_cross) in ctypes:
for langname, compiler in complist.items():
- if langname == 'java' or langname == 'vala' or\
- langname == 'rust' or langname == 'cs':
+ if langname == 'java' \
+ or langname == 'vala' \
+ or langname == 'rust' \
+ or langname == 'cs':
continue
crstr = ''
cross_args = []
@@ -1617,7 +1619,7 @@ rule FORTRAN_DEP_HACK
raise InvalidArguments(
'Namespace collision: module %s defined in '
'two files %s and %s.' %
- (modname, module_files[modname], s))
+ (modname, module_files[modname], s))
module_files[modname] = s
self.fortran_deps[target.get_basename()] = module_files
diff --git a/mesonbuild/build.py b/mesonbuild/build.py
index 16ef5aa..8fa6ada 100644
--- a/mesonbuild/build.py
+++ b/mesonbuild/build.py
@@ -289,9 +289,9 @@ class BuildTarget():
self.process_objectlist(objects)
self.process_kwargs(kwargs, environment)
self.check_unknown_kwargs(kwargs)
- if len(self.sources) == 0 and \
- len(self.generated) == 0 and \
- len(self.objects) == 0:
+ if len(self.sources) == 0 \
+ and len(self.generated) == 0 \
+ and len(self.objects) == 0:
raise InvalidArguments('Build target %s has no sources.' % name)
self.process_compilers()
self.validate_sources()
diff --git a/mesonbuild/compilers.py b/mesonbuild/compilers.py
index edc4712..649e6c1 100644
--- a/mesonbuild/compilers.py
+++ b/mesonbuild/compilers.py
@@ -187,8 +187,7 @@ gnu_color_args = {'auto': ['-fdiagnostics-color=auto'],
'never': ['-fdiagnostics-color=never'],
}
-base_options = {
- 'b_pch': coredata.UserBooleanOption('b_pch', 'Use precompiled headers', True),
+base_options = {'b_pch': coredata.UserBooleanOption('b_pch', 'Use precompiled headers', True),
'b_lto': coredata.UserBooleanOption('b_lto', 'Use link time optimization', False),
'b_sanitize': coredata.UserComboOption('b_sanitize',
'Code sanitizer to use',
@@ -2168,8 +2167,7 @@ class GnuCCompiler(GnuCompiler, CCompiler):
if self.gcc_type == GCC_MINGW:
opts.update({
'c_winlibs': coredata.UserStringArrayOption('c_winlibs', 'Standard Win libraries to link against',
- gnu_winlibs),
- })
+ gnu_winlibs), })
return opts
def get_option_compile_args(self, options):
@@ -2208,8 +2206,7 @@ class GnuCPPCompiler(GnuCompiler, CPPCompiler):
if self.gcc_type == GCC_MINGW:
opts.update({
'cpp_winlibs': coredata.UserStringArrayOption('cpp_winlibs', 'Standard Win libraries to link against',
- gnu_winlibs),
- })
+ gnu_winlibs), })
return opts
def get_option_compile_args(self, options):
diff --git a/mesonbuild/coredata.py b/mesonbuild/coredata.py
index a9dbcdd..080067d 100644
--- a/mesonbuild/coredata.py
+++ b/mesonbuild/coredata.py
@@ -201,19 +201,19 @@ def get_builtin_option_default(optname):
raise RuntimeError('Tried to get the default value for an unknown builtin option \'%s\'.' % optname)
builtin_options = {
- 'buildtype': [UserComboOption, 'Build type to use.', ['plain', 'debug', 'debugoptimized', 'release', 'minsize'], 'debug'],
- 'strip': [UserBooleanOption, 'Strip targets on install.', False],
- 'unity': [UserBooleanOption, 'Unity build.', False],
- 'prefix': [UserStringOption, 'Installation prefix.', default_prefix()],
- 'libdir': [UserStringOption, 'Library directory.', default_libdir()],
- 'libexecdir': [UserStringOption, 'Library executable directory.', default_libexecdir()],
- 'bindir': [UserStringOption, 'Executable directory.', 'bin'],
- 'sbindir': [UserStringOption, 'System executable directory.', 'sbin'],
- 'includedir': [UserStringOption, 'Header file directory.', 'include'],
- 'datadir': [UserStringOption, 'Data file directory.', 'share'],
- 'mandir': [UserStringOption, 'Manual page directory.', 'share/man'],
- 'infodir': [UserStringOption, 'Info page directory.', 'share/info'],
- 'localedir': [UserStringOption, 'Locale data directory.', 'share/locale'],
+ 'buildtype': [UserComboOption, 'Build type to use.', ['plain', 'debug', 'debugoptimized', 'release', 'minsize'], 'debug'],
+ 'strip': [UserBooleanOption, 'Strip targets on install.', False],
+ 'unity': [UserBooleanOption, 'Unity build.', False],
+ 'prefix': [UserStringOption, 'Installation prefix.', default_prefix()],
+ 'libdir': [UserStringOption, 'Library directory.', default_libdir()],
+ 'libexecdir': [UserStringOption, 'Library executable directory.', default_libexecdir()],
+ 'bindir': [UserStringOption, 'Executable directory.', 'bin'],
+ 'sbindir': [UserStringOption, 'System executable directory.', 'sbin'],
+ 'includedir': [UserStringOption, 'Header file directory.', 'include'],
+ 'datadir': [UserStringOption, 'Data file directory.', 'share'],
+ 'mandir': [UserStringOption, 'Manual page directory.', 'share/man'],
+ 'infodir': [UserStringOption, 'Info page directory.', 'share/info'],
+ 'localedir': [UserStringOption, 'Locale data directory.', 'share/locale'],
# sysconfdir, localstatedir and sharedstatedir are a bit special. These defaults to ${prefix}/etc,
# ${prefix}/var and ${prefix}/com but nobody uses that. Instead they always set it
# manually to /etc, /var and /var/lib. This default values is thus pointless and not really used
@@ -223,17 +223,17 @@ builtin_options = {
# to set the following in project():
#
# default_options : ['sysconfdir=/etc', 'localstatedir=/var', 'sharedstatedir=/var/lib']
- 'sysconfdir': [UserStringOption, 'Sysconf data directory.', 'etc'],
- 'localstatedir': [UserStringOption, 'Localstate data directory.', 'var'],
- 'sharedstatedir': [UserStringOption, 'Architecture-independent data directory.', 'com'],
- 'werror': [UserBooleanOption, 'Treat warnings as errors.', False],
- 'warning_level': [UserComboOption, 'Compiler warning level to use.', ['1', '2', '3'], '1'],
- 'layout': [UserComboOption, 'Build directory layout.', ['mirror', 'flat'], 'mirror'],
- 'default_library': [UserComboOption, 'Default library type.', ['shared', 'static'], 'shared'],
- 'backend': [UserComboOption, 'Backend to use.', backendlist, 'ninja'],
- 'stdsplit': [UserBooleanOption, 'Split stdout and stderr in test logs.', True],
- 'errorlogs': [UserBooleanOption, "Whether to print the logs from failing tests.", True],
- }
+ 'sysconfdir': [UserStringOption, 'Sysconf data directory.', 'etc'],
+ 'localstatedir': [UserStringOption, 'Localstate data directory.', 'var'],
+ 'sharedstatedir': [UserStringOption, 'Architecture-independent data directory.', 'com'],
+ 'werror': [UserBooleanOption, 'Treat warnings as errors.', False],
+ 'warning_level': [UserComboOption, 'Compiler warning level to use.', ['1', '2', '3'], '1'],
+ 'layout': [UserComboOption, 'Build directory layout.', ['mirror', 'flat'], 'mirror'],
+ 'default_library': [UserComboOption, 'Default library type.', ['shared', 'static'], 'shared'],
+ 'backend': [UserComboOption, 'Backend to use.', backendlist, 'ninja'],
+ 'stdsplit': [UserBooleanOption, 'Split stdout and stderr in test logs.', True],
+ 'errorlogs': [UserBooleanOption, "Whether to print the logs from failing tests.", True],
+}
forbidden_target_names = {'clean': None,
'clean-ctlist': None,
diff --git a/mesonbuild/dependencies.py b/mesonbuild/dependencies.py
index 976adf0..e77abb8 100644
--- a/mesonbuild/dependencies.py
+++ b/mesonbuild/dependencies.py
@@ -1109,9 +1109,11 @@ why. As a hack filter out everything that is not a flag."""
as -O2 and so on. Drop everything that is not needed."""
result = []
for f in args:
- if f.startswith('-D') or f.startswith('-f') or \
- f.startswith('-I') or f == '-pthread' or\
- (f.startswith('-W') and not f == '-Wall'):
+ if f.startswith('-D') \
+ or f.startswith('-f') \
+ or f.startswith('-I') \
+ or f == '-pthread' \
+ or (f.startswith('-W') and not f == '-Wall'):
result.append(f)
return result
diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py
index 70074ed..720546f 100644
--- a/mesonbuild/environment.py
+++ b/mesonbuild/environment.py
@@ -231,7 +231,7 @@ class Environment():
# Versioning is added to these names in the backends as-needed.
cross = self.is_cross_build()
if (not cross and mesonlib.is_windows()) \
- or (cross and self.cross_info.has_host() and self.cross_info.config['host_machine']['system'] == 'windows'):
+ or (cross and self.cross_info.has_host() and self.cross_info.config['host_machine']['system'] == 'windows'):
self.exe_suffix = 'exe'
self.object_suffix = 'obj'
self.win_libdir_layout = True
diff --git a/mesonbuild/interpreter.py b/mesonbuild/interpreter.py
index 95e0136..33c592c 100644
--- a/mesonbuild/interpreter.py
+++ b/mesonbuild/interpreter.py
@@ -2446,8 +2446,8 @@ requirements use the version keyword argument instead.''')
def add_cross_stdlib_info(self, target):
for l in self.get_used_languages(target):
- if self.environment.cross_info.has_stdlib(l) and \
- self.subproject != self.environment.cross_info.get_stdlib(l)[0]:
+ if self.environment.cross_info.has_stdlib(l) \
+ and self.subproject != self.environment.cross_info.get_stdlib(l)[0]:
target.add_deps(self.build.cross_stdlibs[l])
def check_sources_exist(self, subdir, sources):
diff --git a/mesonbuild/mparser.py b/mesonbuild/mparser.py
index 6b1c8ee..fa8ade2 100644
--- a/mesonbuild/mparser.py
+++ b/mesonbuild/mparser.py
@@ -107,8 +107,10 @@ class Lexer:
elif tid == 'dblquote':
raise ParseException('Double quotes are not supported. Use single quotes.', lineno, col)
elif tid == 'string':
- value = match_text[1:-1].replace(r"\'", "'").replace(r" \\ ".strip(), r" \ ".strip())\
- .replace("\\n", "\n")
+ value = match_text[1:-1]\
+ .replace(r"\'", "'")\
+ .replace(r" \\ ".strip(), r" \ ".strip())\
+ .replace("\\n", "\n")
elif tid == 'multiline_string':
tid = 'string'
value = match_text[3:-3]
diff --git a/mesonbuild/scripts/__init__.py b/mesonbuild/scripts/__init__.py
index b2f2258..af6bedc 100644
--- a/mesonbuild/scripts/__init__.py
+++ b/mesonbuild/scripts/__init__.py
@@ -14,7 +14,7 @@
def destdir_join(d1, d2):
# c:\destdir + c:\prefix must produce c:\destdir\prefix
- if len(d1) > 1 and d1[1] == ':' and \
- len(d2) > 1 and d2[1] == ':':
+ if len(d1) > 1 and d1[1] == ':' \
+ and len(d2) > 1 and d2[1] == ':':
return d1 + d2[2:]
return d1 + d2
diff --git a/mesontest.py b/mesontest.py
index af4ae2a..df71d04 100755
--- a/mesontest.py
+++ b/mesontest.py
@@ -281,8 +281,8 @@ class TestHarness:
(num, name, padding1, result.res, padding2, result.duration)
print(result_str)
result_str += "\n\n" + result.get_log()
- if (result.returncode != GNU_SKIP_RETURNCODE) and \
- (result.returncode != 0) != result.should_fail:
+ if (result.returncode != GNU_SKIP_RETURNCODE) \
+ and (result.returncode != 0) != result.should_fail:
if self.options.print_errorlogs:
self.collected_logs.append(result_str)
if logfile:
diff --git a/tools/cmake2meson.py b/tools/cmake2meson.py
index b108cf5..647d0c3 100755
--- a/tools/cmake2meson.py
+++ b/tools/cmake2meson.py
@@ -121,8 +121,9 @@ class Parser():
args.append(self.arguments())
self.expect('rparen')
arg = self.current
- if self.accept('string') or self.accept('varexp') or\
- self.accept('id'):
+ if self.accept('string') \
+ or self.accept('varexp') \
+ or self.accept('id'):
args.append(arg)
rest = self.arguments()
args += rest