diff options
author | Alf Henrik Sauge <alf.henrik.sauge@gmail.com> | 2022-08-11 15:18:27 +0200 |
---|---|---|
committer | Eli Schwartz <eschwartz93@gmail.com> | 2022-08-26 17:12:40 -0400 |
commit | 06bf9a5cdae6a185a29e5ea5bcaf18ad3e3e042a (patch) | |
tree | a909a90a2734935d732dcc087dc173d80da76425 /mesonbuild/compilers | |
parent | 47a0ed5924ea05ac58a9a36f60670b79e76c6273 (diff) | |
download | meson-06bf9a5cdae6a185a29e5ea5bcaf18ad3e3e042a.zip meson-06bf9a5cdae6a185a29e5ea5bcaf18ad3e3e042a.tar.gz meson-06bf9a5cdae6a185a29e5ea5bcaf18ad3e3e042a.tar.bz2 |
Fix purely white space issues reported by flake8
Diffstat (limited to 'mesonbuild/compilers')
-rw-r--r-- | mesonbuild/compilers/cuda.py | 18 | ||||
-rw-r--r-- | mesonbuild/compilers/mixins/clike.py | 2 | ||||
-rw-r--r-- | mesonbuild/compilers/mixins/visualstudio.py | 2 |
3 files changed, 10 insertions, 12 deletions
diff --git a/mesonbuild/compilers/cuda.py b/mesonbuild/compilers/cuda.py index 172b9a5..8965644 100644 --- a/mesonbuild/compilers/cuda.py +++ b/mesonbuild/compilers/cuda.py @@ -230,7 +230,7 @@ class CudaCompiler(Compiler): instring = False argit = iter(arg) for c in argit: - if c == CM and not instring: + if c == CM and not instring: l.append('') elif c == DQ: l[-1] += c @@ -364,7 +364,7 @@ class CudaCompiler(Compiler): continue # Handle breakup of flag-values into a flag-part and value-part. - if flag[:1] not in '-/': + if flag[:1] not in '-/': # This is not a flag. It's probably a file input. Pass it through. xflags.append(flag) continue @@ -379,7 +379,7 @@ class CudaCompiler(Compiler): # This is a single-letter short option. These options (with the # exception of -o) are allowed to receive their argument with neither # space nor = sign before them. Detect and separate them in that event. - if flag[2:3] == '': # -I something + if flag[2:3] == '': # -I something try: val = next(flagit) except StopIteration: @@ -390,7 +390,7 @@ class CudaCompiler(Compiler): val = flag[2:] flag = flag[:2] # -I elif flag in self._FLAG_LONG2SHORT_WITHARGS or \ - flag in self._FLAG_SHORT2LONG_WITHARGS: + flag in self._FLAG_SHORT2LONG_WITHARGS: # This is either -o or a multi-letter flag, and it is receiving its # value isolated. try: @@ -398,7 +398,7 @@ class CudaCompiler(Compiler): except StopIteration: pass elif flag.split('=', 1)[0] in self._FLAG_LONG2SHORT_WITHARGS or \ - flag.split('=', 1)[0] in self._FLAG_SHORT2LONG_WITHARGS: + flag.split('=', 1)[0] in self._FLAG_SHORT2LONG_WITHARGS: # This is either -o or a multi-letter flag, and it is receiving its # value after an = sign. flag, val = flag.split('=', 1) # -o=something @@ -412,7 +412,7 @@ class CudaCompiler(Compiler): # We do not know whether this GCC-speak flag takes an isolated # argument. Assuming it does not (the vast majority indeed don't), # wrap this argument in an -Xcompiler flag and send it down to NVCC. - if flag == '-ffast-math': + if flag == '-ffast-math': xflags.append('-use_fast_math') xflags.append('-Xcompiler='+flag) elif flag == '-fno-fast-math': @@ -436,7 +436,7 @@ class CudaCompiler(Compiler): # Take care of the various NVCC-supported flags that need special handling. flag = self._FLAG_LONG2SHORT_WITHARGS.get(flag, flag) - if flag in {'-include', '-isystem', '-I', '-L', '-l'}: + if flag in {'-include', '-isystem', '-I', '-L', '-l'}: # These flags are known to GCC, but list-valued in NVCC. They potentially # require double-quoting to prevent NVCC interpreting the flags as lists # when GCC would not have done so. @@ -456,7 +456,7 @@ class CudaCompiler(Compiler): xflags.append(self._shield_nvcc_list_arg(val)) elif flag == '-O': # Handle optimization levels GCC knows about that NVCC does not. - if val == 'fast': + if val == 'fast': xflags.append('-O3') xflags.append('-use_fast_math') xflags.append('-Xcompiler') @@ -617,7 +617,7 @@ class CudaCompiler(Compiler): def get_options(self) -> 'MutableKeyedOptionDictType': opts = super().get_options() - std_key = OptionKey('std', machine=self.for_machine, lang=self.language) + std_key = OptionKey('std', machine=self.for_machine, lang=self.language) ccbindir_key = OptionKey('ccbindir', machine=self.for_machine, lang=self.language) opts.update({ std_key: coredata.UserComboOption('C++ language standard to use with CUDA', diff --git a/mesonbuild/compilers/mixins/clike.py b/mesonbuild/compilers/mixins/clike.py index 7f43fe2..696d01c 100644 --- a/mesonbuild/compilers/mixins/clike.py +++ b/mesonbuild/compilers/mixins/clike.py @@ -979,7 +979,6 @@ class CLikeCompiler(Compiler): return m.cpu_family == 'x86' return None - def symbols_have_underscore_prefix(self, env: 'Environment') -> bool: ''' Check if the compiler prefixes an underscore to global C symbols @@ -999,7 +998,6 @@ class CLikeCompiler(Compiler): # most unreliable way of checking this, see #5482 return self._symbols_have_underscore_prefix_searchbin(env) - def _get_patterns(self, env: 'Environment', prefixes: T.List[str], suffixes: T.List[str], shared: bool = False) -> T.List[str]: patterns = [] # type: T.List[str] for p in prefixes: diff --git a/mesonbuild/compilers/mixins/visualstudio.py b/mesonbuild/compilers/mixins/visualstudio.py index f4f2f1e..81ecf74 100644 --- a/mesonbuild/compilers/mixins/visualstudio.py +++ b/mesonbuild/compilers/mixins/visualstudio.py @@ -299,7 +299,7 @@ class VisualStudioLikeCompiler(Compiler, metaclass=abc.ABCMeta): with self._build_wrapper(code, env, extra_args=args, mode=mode) as p: if p.returncode != 0: return False, p.cached - return not(warning_text in p.stderr or warning_text in p.stdout), p.cached + return not (warning_text in p.stderr or warning_text in p.stdout), p.cached def get_compile_debugfile_args(self, rel_obj: str, pch: bool = False) -> T.List[str]: pdbarr = rel_obj.split('.')[:-1] |