summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2025-06-11 13:52:52 +0200
committerJussi Pakkanen <jussi.pakkanen@mailbox.org>2025-06-18 20:17:55 +0300
commitfc2c68aa1b16a1895f4fdc8e7000d50952a47ecb (patch)
tree842a4747b4776c1e07ea161c9716a2c4e84736a5
parent7f908d909ea6874af0512e2258777f5cd42be790 (diff)
downloadmeson-fc2c68aa1b16a1895f4fdc8e7000d50952a47ecb.tar.gz
compilers: pgi: fix preprocessing arguments
Based on reports from the users, PGI compilers need an explicit "-o -" on the command line to emit preprocessed output on stdout. Override the methods in the PGICompiler mixin to add it when output goes to stdout but not when output goes elsewhere. Fixes: #13216 Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
-rw-r--r--mesonbuild/compilers/mixins/pgi.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/mesonbuild/compilers/mixins/pgi.py b/mesonbuild/compilers/mixins/pgi.py
index 50335c895..fddc8378f 100644
--- a/mesonbuild/compilers/mixins/pgi.py
+++ b/mesonbuild/compilers/mixins/pgi.py
@@ -54,6 +54,12 @@ class PGICompiler(Compiler):
def openmp_flags(self, env: Environment) -> T.List[str]:
return ['-mp']
+ def get_preprocess_only_args(self) -> T.List[str]:
+ return ['-E', '-P', '-o', '-']
+
+ def get_preprocess_to_file_args(self) -> T.List[str]:
+ return ['-E', '-P']
+
def get_optimization_args(self, optimization_level: str) -> T.List[str]:
return clike_optimization_args[optimization_level]