diff options
author | Daniel Mensinger <daniel@mensinger-ka.de> | 2021-06-15 15:11:00 +0200 |
---|---|---|
committer | Daniel Mensinger <daniel@mensinger-ka.de> | 2021-06-18 23:48:33 +0200 |
commit | 850f64b9ab9a7b8ed21d11ccd7cfd434b08fab5a (patch) | |
tree | 164847510a661e25c64da51b9709da08defee4eb | |
parent | 2c08e55f85cf391b4debece98b398e476a41c761 (diff) | |
download | meson-850f64b9ab9a7b8ed21d11ccd7cfd434b08fab5a.zip meson-850f64b9ab9a7b8ed21d11ccd7cfd434b08fab5a.tar.gz meson-850f64b9ab9a7b8ed21d11ccd7cfd434b08fab5a.tar.bz2 |
build: textwrap.dedent() some strings
-rw-r--r-- | mesonbuild/build.py | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/mesonbuild/build.py b/mesonbuild/build.py index d75aa16..8724cab7 100644 --- a/mesonbuild/build.py +++ b/mesonbuild/build.py @@ -20,6 +20,7 @@ import itertools, pathlib import os import pickle import re +import textwrap import typing as T from . import environment @@ -464,9 +465,11 @@ class Target: def __init__(self, name: str, subdir: str, subproject: str, build_by_default: bool, for_machine: MachineChoice): if has_path_sep(name): # Fix failing test 53 when this becomes an error. - mlog.warning(f'''Target "{name}" has a path separator in its name. -This is not supported, it can cause unexpected failures and will become -a hard error in the future.''') + mlog.warning(textwrap.dedent(f'''\ + Target "{name}" has a path separator in its name. + This is not supported, it can cause unexpected failures and will become + a hard error in the future.\ + ''')) self.name = name self.subdir = subdir self.subproject = subproject @@ -959,11 +962,13 @@ class BuildTarget(Target): llist = extract_as_list(kwargs, 'link_with') for linktarget in unholder(llist): if isinstance(linktarget, dependencies.ExternalLibrary): - raise MesonException('''An external library was used in link_with keyword argument, which -is reserved for libraries built as part of this project. External -libraries must be passed using the dependencies keyword argument -instead, because they are conceptually "external dependencies", -just like those detected with the dependency() function.''') + raise MesonException(textwrap.dedent('''\ + An external library was used in link_with keyword argument, which + is reserved for libraries built as part of this project. External + libraries must be passed using the dependencies keyword argument + instead, because they are conceptually "external dependencies", + just like those detected with the dependency() function.\ + ''')) self.link(linktarget) lwhole = extract_as_list(kwargs, 'link_whole') for linktarget in lwhole: @@ -1012,8 +1017,11 @@ just like those detected with the dependency() function.''') raise InvalidArguments('Link_args arguments must be strings.') for l in self.link_args: if '-Wl,-rpath' in l or l.startswith('-rpath'): - mlog.warning('''Please do not define rpath with a linker argument, use install_rpath or build_rpath properties instead. -This will become a hard error in a future Meson release.''') + mlog.warning(textwrap.dedent('''\ + Please do not define rpath with a linker argument, use install_rpath + or build_rpath properties instead. + This will become a hard error in a future Meson release.\ + ''')) self.process_link_depends(kwargs.get('link_depends', []), environment) # Target-specific include dirs must be added BEFORE include dirs from # internal deps (added inside self.add_deps()) to override them. |