diff options
-rw-r--r-- | mesonbuild/backend/backends.py | 8 | ||||
-rw-r--r-- | mesonbuild/backend/ninjabackend.py | 61 | ||||
-rw-r--r-- | mesonbuild/backend/vs2010backend.py | 2 | ||||
-rw-r--r-- | mesonbuild/backend/xcodebackend.py | 2 | ||||
-rw-r--r-- | mesonbuild/dependencies.py | 6 | ||||
-rw-r--r-- | mesonbuild/interpreter.py | 10 | ||||
-rw-r--r-- | mesonbuild/modules/qt4.py | 6 | ||||
-rw-r--r-- | mesonbuild/modules/qt5.py | 6 |
8 files changed, 51 insertions, 50 deletions
diff --git a/mesonbuild/backend/backends.py b/mesonbuild/backend/backends.py index 7e3f936..e857d60 100644 --- a/mesonbuild/backend/backends.py +++ b/mesonbuild/backend/backends.py @@ -90,7 +90,7 @@ class Backend(): def get_target_filename(self, t): if isinstance(t, build.CustomTarget): if len(t.get_outputs()) != 1: - mlog.warning('custom_target {!r} has more than one output! ' \ + mlog.warning('custom_target {!r} has more than one output! ' 'Using the first one.'.format(t.name)) filename = t.get_outputs()[0] else: @@ -177,7 +177,7 @@ class Backend(): return result def relpath(self, todir, fromdir): - return os.path.relpath(os.path.join('dummyprefixdir', todir),\ + return os.path.relpath(os.path.join('dummyprefixdir', todir), os.path.join('dummyprefixdir', fromdir)) def flatten_object_list(self, target, proj_dir_to_build_root=''): @@ -457,7 +457,7 @@ class Backend(): def get_regen_filelist(self): '''List of all files whose alteration means that the build definition needs to be regenerated.''' - deps = [os.path.join(self.build_to_src, df) \ + deps = [os.path.join(self.build_to_src, df) for df in self.interpreter.get_build_def_files()] if self.environment.is_cross_build(): deps.append(os.path.join(self.build_to_src, @@ -548,7 +548,7 @@ class Backend(): if not absolute_outputs: ofilenames = [os.path.join(self.get_target_dir(target), i) for i in target.output] else: - ofilenames = [os.path.join(self.environment.get_build_dir(), self.get_target_dir(target), i) \ + ofilenames = [os.path.join(self.environment.get_build_dir(), self.get_target_dir(target), i) for i in target.output] srcs = self.get_custom_target_sources(target) outdir = self.get_target_dir(target) diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py index 429bb64..52a6f93 100644 --- a/mesonbuild/backend/ninjabackend.py +++ b/mesonbuild/backend/ninjabackend.py @@ -92,9 +92,10 @@ 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: @@ -558,12 +559,12 @@ int dummy; if gcovr_exe: added_rule = True elem = NinjaBuildElement(self.all_outputs, 'coverage-xml', 'CUSTOM_COMMAND', '') - elem.add_item('COMMAND', [gcovr_exe, '-x', '-r', self.environment.get_source_dir(),\ + elem.add_item('COMMAND', [gcovr_exe, '-x', '-r', self.environment.get_source_dir(), '-o', os.path.join(self.environment.get_log_dir(), 'coverage.xml')]) elem.add_item('DESC', 'Generating XML coverage report.') elem.write(outfile) elem = NinjaBuildElement(self.all_outputs, 'coverage-text', 'CUSTOM_COMMAND', '') - elem.add_item('COMMAND', [gcovr_exe, '-r', self.environment.get_source_dir(),\ + elem.add_item('COMMAND', [gcovr_exe, '-r', self.environment.get_source_dir(), '-o', os.path.join(self.environment.get_log_dir(), 'coverage.txt')]) elem.add_item('DESC', 'Generating text coverage report.') elem.write(outfile) @@ -574,10 +575,10 @@ int dummy; phony_elem = NinjaBuildElement(self.all_outputs, 'coverage-html', 'phony', os.path.join(htmloutdir, 'index.html')) phony_elem.write(outfile) elem = NinjaBuildElement(self.all_outputs, os.path.join(htmloutdir, 'index.html'), 'CUSTOM_COMMAND', '') - command = [lcov_exe, '--directory', self.environment.get_build_dir(),\ - '--capture', '--output-file', covinfo, '--no-checksum',\ - '&&', genhtml_exe, '--prefix', self.environment.get_build_dir(),\ - '--output-directory', htmloutdir, '--title', 'Code coverage',\ + command = [lcov_exe, '--directory', self.environment.get_build_dir(), + '--capture', '--output-file', covinfo, '--no-checksum', + '&&', genhtml_exe, '--prefix', self.environment.get_build_dir(), + '--output-directory', htmloutdir, '--title', 'Code coverage', '--legend', '--show-details', covinfo] elem.add_item('COMMAND', command) elem.add_item('DESC', 'Generating HTML coverage report.') @@ -1235,9 +1236,9 @@ int dummy; ''' else: command_templ = ' command = %s $LINK_ARGS %s $in\n' - command = command_templ %\ - (' '.join(static_linker.get_exelist()), - ' '.join(static_linker.get_output_args('$out'))) + command = command_templ % ( + ' '.join(static_linker.get_exelist()), + ' '.join(static_linker.get_output_args('$out'))) description = ' description = Static linking library $out\n\n' outfile.write(rule) outfile.write(command) @@ -1274,10 +1275,10 @@ int dummy; ''' else: command_template = ' command = %s %s $ARGS %s $in $LINK_ARGS $aliasing\n' - command = command_template % \ - (' '.join(compiler.get_linker_exelist()),\ - ' '.join(cross_args),\ - ' '.join(compiler.get_linker_output_args('$out'))) + command = command_template % ( + ' '.join(compiler.get_linker_exelist()), + ' '.join(cross_args), + ' '.join(compiler.get_linker_output_args('$out'))) description = ' description = Linking target $out' outfile.write(rule) outfile.write(command) @@ -1449,12 +1450,12 @@ rule FORTRAN_DEP_HACK ''' else: command_template = ' command = %s %s $ARGS %s %s %s $in\n' - command = command_template % \ - (' '.join([ninja_quote(i) for i in compiler.get_exelist()]),\ - ' '.join(cross_args), - ' '.join(quoted_depargs),\ - ' '.join(compiler.get_output_args('$out')),\ - ' '.join(compiler.get_compile_only_args())) + command = command_template % ( + ' '.join([ninja_quote(i) for i in compiler.get_exelist()]), + ' '.join(cross_args), + ' '.join(quoted_depargs), + ' '.join(compiler.get_output_args('$out')), + ' '.join(compiler.get_compile_only_args())) description = ' description = Compiling %s object $out\n' % langname if compiler.get_id() == 'msvc': deps = ' deps = msvc\n' @@ -1492,12 +1493,12 @@ rule FORTRAN_DEP_HACK output = '' else: output = ' '.join(compiler.get_output_args('$out')) - command = " command = %s %s $ARGS %s %s %s $in\n" % \ - (' '.join(compiler.get_exelist()),\ - ' '.join(cross_args),\ - ' '.join(quoted_depargs),\ - output,\ - ' '.join(compiler.get_compile_only_args())) + command = " command = %s %s $ARGS %s %s %s $in\n" % ( + ' '.join(compiler.get_exelist()), + ' '.join(cross_args), + ' '.join(quoted_depargs), + output, + ' '.join(compiler.get_compile_only_args())) description = ' description = Precompiling header %s\n' % '$in' if compiler.get_id() == 'msvc': deps = ' deps = msvc\n' @@ -1564,7 +1565,7 @@ rule FORTRAN_DEP_HACK depfilename = generator.get_dep_outname(infilename) depfile = os.path.join(self.get_target_private_dir(target), depfilename) args = [x.replace('@DEPFILE@', depfile) for x in base_args] - args = [x.replace("@INPUT@", infilename).replace('@OUTPUT@', sole_output)\ + args = [x.replace("@INPUT@", infilename).replace('@OUTPUT@', sole_output) for x in args] args = self.replace_outputs(args, self.get_target_private_dir(target), outfilelist) # We have consumed output files, so drop them from the list of remaining outputs. @@ -2062,7 +2063,7 @@ rule FORTRAN_DEP_HACK if isinstance(d, build.StaticLibrary): for dep in d.get_external_deps(): commands += dep.get_link_args() - commands += linker.build_rpath_args(self.environment.get_build_dir(),\ + commands += linker.build_rpath_args(self.environment.get_build_dir(), self.determine_rpath_dirs(target), target.install_rpath) custom_target_libraries = self.get_custom_target_provided_libraries(target) commands += extra_args diff --git a/mesonbuild/backend/vs2010backend.py b/mesonbuild/backend/vs2010backend.py index e9d7389..7e6831a 100644 --- a/mesonbuild/backend/vs2010backend.py +++ b/mesonbuild/backend/vs2010backend.py @@ -125,7 +125,7 @@ class Vs2010Backend(backends.Backend): outfiles_rel = genlist.get_outputs_for(curfile) outfiles = [os.path.join(target_private_dir, of) for of in outfiles_rel] generator_output_files += outfiles - args = [x.replace("@INPUT@", infilename).replace('@OUTPUT@', sole_output)\ + args = [x.replace("@INPUT@", infilename).replace('@OUTPUT@', sole_output) for x in base_args] args = self.replace_outputs(args, target_private_dir, outfiles_rel) args = [x.replace("@SOURCE_DIR@", self.environment.get_source_dir()).replace("@BUILD_DIR@", target_private_dir) diff --git a/mesonbuild/backend/xcodebackend.py b/mesonbuild/backend/xcodebackend.py index 7ab3813..622c802 100644 --- a/mesonbuild/backend/xcodebackend.py +++ b/mesonbuild/backend/xcodebackend.py @@ -405,7 +405,7 @@ class XCodeBackend(backends.Backend): self.write_line('%s /* %s */ = {' % (idval, tname)) self.indent_level += 1 self.write_line('isa = PBXNativeTarget;') - self.write_line('buildConfigurationList = %s /* Build configuration list for PBXNativeTarget "%s" */;'\ + self.write_line('buildConfigurationList = %s /* Build configuration list for PBXNativeTarget "%s" */;' % (self.buildconflistmap[tname], tname)) self.write_line('buildPhases = (') self.indent_level += 1 diff --git a/mesonbuild/dependencies.py b/mesonbuild/dependencies.py index 4daa296..1efebe9 100644 --- a/mesonbuild/dependencies.py +++ b/mesonbuild/dependencies.py @@ -194,7 +194,7 @@ class PkgConfigDependency(Dependency): def _set_cargs(self): ret, out = self._call_pkgbin(['--cflags', self.name]) if ret != 0: - raise DependencyException('Could not generate cargs for %s:\n\n%s' % \ + raise DependencyException('Could not generate cargs for %s:\n\n%s' % (self.name, out)) self.cargs = out.split() @@ -204,7 +204,7 @@ class PkgConfigDependency(Dependency): libcmd.append('--static') ret, out = self._call_pkgbin(libcmd) if ret != 0: - raise DependencyException('Could not generate libs for %s:\n\n%s' % \ + raise DependencyException('Could not generate libs for %s:\n\n%s' % (self.name, out)) self.libs = [] for lib in out.split(): @@ -332,7 +332,7 @@ class WxDependency(Dependency): version_req = kwargs.get('version', None) if version_req is not None: if not version_compare(self.modversion, version_req, strict=True): - mlog.log('Wxwidgets version %s does not fullfill requirement %s' %\ + mlog.log('Wxwidgets version %s does not fullfill requirement %s' % (self.modversion, version_req)) return mlog.log('Dependency wxwidgets found:', mlog.green('YES')) diff --git a/mesonbuild/interpreter.py b/mesonbuild/interpreter.py index c736cd0..474a82f 100644 --- a/mesonbuild/interpreter.py +++ b/mesonbuild/interpreter.py @@ -1329,7 +1329,7 @@ class Interpreter(InterpreterBase): try: di = mesonlib.stringlistify(cross_info.get_stdlib(l)) if len(di) != 2: - raise InterpreterException('Stdlib definition for %s should have exactly two elements.' \ + raise InterpreterException('Stdlib definition for %s should have exactly two elements.' % l) projname, depname = di subproj = self.do_subproject(projname, {}) @@ -1574,13 +1574,13 @@ class Interpreter(InterpreterBase): @stringArgs def func_project(self, node, args, kwargs): - if self.environment.first_invocation and ('default_options' in kwargs or \ + if self.environment.first_invocation and ('default_options' in kwargs or len(self.default_project_options) > 0): self.parse_default_options(kwargs['default_options']) if not self.is_subproject(): self.build.project_name = args[0] if os.path.exists(self.option_file): - oi = optinterpreter.OptionInterpreter(self.subproject, \ + oi = optinterpreter.OptionInterpreter(self.subproject, self.build.environment.cmd_line_options.projectoptions, ) oi.process(self.option_file) @@ -2118,7 +2118,7 @@ requirements use the version keyword argument instead.''') prev_subdir = self.subdir subdir = os.path.join(prev_subdir, args[0]) if subdir in self.visited_subdirs: - raise InvalidArguments('Tried to enter directory "%s", which has already been visited.'\ + raise InvalidArguments('Tried to enter directory "%s", which has already been visited.' % subdir) self.visited_subdirs[subdir] = True self.subdir = subdir @@ -2378,7 +2378,7 @@ requirements use the version keyword argument instead.''') if name == '': raise InterpreterException('Target name must not be empty.') if name in coredata.forbidden_target_names: - raise InvalidArguments('Target name "%s" is reserved for Meson\'s internal use. Please rename.'\ + raise InvalidArguments('Target name "%s" is reserved for Meson\'s internal use. Please rename.' % name) # To permit an executable and a shared library to have the # same name, such as "foo.exe" and "libfoo.a". diff --git a/mesonbuild/modules/qt4.py b/mesonbuild/modules/qt4.py index 9a9ec04..33c9f80 100644 --- a/mesonbuild/modules/qt4.py +++ b/mesonbuild/modules/qt4.py @@ -47,7 +47,7 @@ class Qt4Module(ExtensionModule): else: raise MesonException('Moc preprocessor is not for Qt 4. Output:\n%s\n%s' % (stdout, stderr)) - mlog.log(' moc:', mlog.green('YES'), '(%s, %s)' % \ + mlog.log(' moc:', mlog.green('YES'), '(%s, %s)' % (' '.join(self.moc.fullpath), moc_ver.split()[-1])) else: mlog.log(' moc:', mlog.red('NO')) @@ -60,7 +60,7 @@ class Qt4Module(ExtensionModule): else: raise MesonException('Uic compiler is not for Qt4. Output:\n%s\n%s' % (stdout, stderr)) - mlog.log(' uic:', mlog.green('YES'), '(%s, %s)' % \ + mlog.log(' uic:', mlog.green('YES'), '(%s, %s)' % (' '.join(self.uic.fullpath), uic_ver.split()[-1])) else: mlog.log(' uic:', mlog.red('NO')) @@ -73,7 +73,7 @@ class Qt4Module(ExtensionModule): else: raise MesonException('Rcc compiler is not for Qt 4. Output:\n%s\n%s' % (stdout, stderr)) - mlog.log(' rcc:', mlog.green('YES'), '(%s, %s)'\ + mlog.log(' rcc:', mlog.green('YES'), '(%s, %s)' % (' '.join(self.rcc.fullpath), rcc_ver.split()[-1])) else: mlog.log(' rcc:', mlog.red('NO')) diff --git a/mesonbuild/modules/qt5.py b/mesonbuild/modules/qt5.py index cb5c261..b4f1475 100644 --- a/mesonbuild/modules/qt5.py +++ b/mesonbuild/modules/qt5.py @@ -49,7 +49,7 @@ class Qt5Module(ExtensionModule): else: raise MesonException('Moc preprocessor is not for Qt 5. Output:\n%s\n%s' % (stdout, stderr)) - mlog.log(' moc:', mlog.green('YES'), '(%s, %s)' % \ + mlog.log(' moc:', mlog.green('YES'), '(%s, %s)' % (' '.join(self.moc.fullpath), moc_ver.split()[-1])) else: mlog.log(' moc:', mlog.red('NO')) @@ -64,7 +64,7 @@ class Qt5Module(ExtensionModule): else: raise MesonException('Uic compiler is not for Qt 5. Output:\n%s\n%s' % (stdout, stderr)) - mlog.log(' uic:', mlog.green('YES'), '(%s, %s)' % \ + mlog.log(' uic:', mlog.green('YES'), '(%s, %s)' % (' '.join(self.uic.fullpath), uic_ver.split()[-1])) else: mlog.log(' uic:', mlog.red('NO')) @@ -79,7 +79,7 @@ class Qt5Module(ExtensionModule): else: raise MesonException('Rcc compiler is not for Qt 5. Output:\n%s\n%s' % (stdout, stderr)) - mlog.log(' rcc:', mlog.green('YES'), '(%s, %s)'\ + mlog.log(' rcc:', mlog.green('YES'), '(%s, %s)' % (' '.join(self.rcc.fullpath), rcc_ver.split()[-1])) else: mlog.log(' rcc:', mlog.red('NO')) |