diff options
Diffstat (limited to 'mesonbuild/compilers')
-rw-r--r-- | mesonbuild/compilers/cpp.py | 1 | ||||
-rw-r--r-- | mesonbuild/compilers/mixins/pgi.py | 18 |
2 files changed, 17 insertions, 2 deletions
diff --git a/mesonbuild/compilers/cpp.py b/mesonbuild/compilers/cpp.py index 44f53eb..6ae2673 100644 --- a/mesonbuild/compilers/cpp.py +++ b/mesonbuild/compilers/cpp.py @@ -274,7 +274,6 @@ class PGICPPCompiler(PGICompiler, CPPCompiler): CPPCompiler.__init__(self, exelist, version, for_machine, is_cross, exe_wrapper, **kwargs) PGICompiler.__init__(self, compiler_type) - class ElbrusCPPCompiler(GnuCPPCompiler, ElbrusCompiler): def __init__(self, exelist, version, compiler_type, for_machine: MachineChoice, is_cross, exe_wrapper=None, defines=None, **kwargs): GnuCPPCompiler.__init__(self, exelist, version, compiler_type, for_machine, is_cross, exe_wrapper, defines, **kwargs) diff --git a/mesonbuild/compilers/mixins/pgi.py b/mesonbuild/compilers/mixins/pgi.py index a75c62d..ad94271 100644 --- a/mesonbuild/compilers/mixins/pgi.py +++ b/mesonbuild/compilers/mixins/pgi.py @@ -16,6 +16,7 @@ import typing import os +from pathlib import Path from ..compilers import clike_debug_args, clike_optimization_args @@ -42,8 +43,9 @@ pgi_buildtype_linker_args = { } # type: typing.Dict[str, typing.List[str]] -class PGICompiler: +class PGICompiler(): def __init__(self, compiler_type: 'CompilerType'): + self.base_options = ['b_pch'] self.id = 'pgi' self.compiler_type = compiler_type @@ -93,3 +95,17 @@ class PGICompiler: def get_always_args(self) -> typing.List[str]: return [] + + def get_pch_suffix(self) -> str: + # PGI defaults to .pch suffix for PCH on Linux and Windows with --pch option + return 'pch' + + def get_pch_use_args(self, pch_dir: str, header: str) -> typing.List[str]: + # PGI supports PCH for C++ only. + hdr = Path(pch_dir).resolve().parent / header + if self.language == 'cpp': + return ['--pch', + '--pch_dir', str(hdr.parent), + '-I{}'.format(hdr.parent)] + else: + return [] |