compilers/mixins/pgi: Make type safe

pull/7786/head
Dylan Baker 4 years ago
parent 6dc774f1b6
commit b6c8b8a5be
  1. 13
      mesonbuild/compilers/mixins/pgi.py
  2. 1
      run_mypy.py

@ -20,6 +20,10 @@ from pathlib import Path
from ..compilers import clike_debug_args, clike_optimization_args from ..compilers import clike_debug_args, clike_optimization_args
if T.TYPE_CHECKING:
from ...envconfig import MachineInfo
from ...environment import Environment
pgi_buildtype_args = { pgi_buildtype_args = {
'plain': [], 'plain': [],
'debug': [], 'debug': [],
@ -31,7 +35,12 @@ pgi_buildtype_args = {
class PGICompiler: class PGICompiler:
def __init__(self):
if T.TYPE_CHECKING:
info = MachineInfo('', '', '', '')
language = ''
def __init__(self) -> None:
self.base_options = ['b_pch'] self.base_options = ['b_pch']
self.id = 'pgi' self.id = 'pgi'
@ -94,6 +103,6 @@ class PGICompiler:
else: else:
return [] return []
def thread_flags(self, env): def thread_flags(self, env: 'Environment') -> T.List[str]:
# PGI cannot accept -pthread, it's already threaded # PGI cannot accept -pthread, it's already threaded
return [] return []

@ -26,6 +26,7 @@ modules = [
'mesonbuild/compilers/mixins/gnu.py', 'mesonbuild/compilers/mixins/gnu.py',
'mesonbuild/compilers/mixins/intel.py', 'mesonbuild/compilers/mixins/intel.py',
'mesonbuild/compilers/mixins/islinker.py', 'mesonbuild/compilers/mixins/islinker.py',
'mesonbuild/compilers/mixins/pgi.py',
# 'mesonbuild/coredata.py', # 'mesonbuild/coredata.py',
'mesonbuild/dependencies/boost.py', 'mesonbuild/dependencies/boost.py',
'mesonbuild/dependencies/hdf5.py', 'mesonbuild/dependencies/hdf5.py',

Loading…
Cancel
Save