diff options
| author | Zephyr Lykos <git@mochaa.ws> | 2025-12-06 22:04:48 +0800 |
|---|---|---|
| committer | Dylan Baker <dylan@pnwbakers.com> | 2025-12-08 10:06:30 -0800 |
| commit | 5882e83590c3396b44e309d9332acf63a157f69d (patch) | |
| tree | a899ab7fab0d5320b99360e13ae3ac3a4b79b722 | |
| parent | 49b2c202b8f48451fb594e6501bb31930fa9e616 (diff) | |
| download | meson-5882e83590c3396b44e309d9332acf63a157f69d.tar.gz | |
compilers/nvidia_hpc: compilers: move -std options to get_option_std_args
Fixes: 6c88d9992192379511c4777c526786cbacf06167
Fixes: d3542ff690d0be723cfd3ebfaaac99290517837f
Fixes: ff0c758b2a8015f7e7ca6fc627c29ef7bb4771b3
| -rw-r--r-- | mesonbuild/compilers/c.py | 8 | ||||
| -rw-r--r-- | mesonbuild/compilers/cpp.py | 8 |
2 files changed, 16 insertions, 0 deletions
diff --git a/mesonbuild/compilers/c.py b/mesonbuild/compilers/c.py index 7143d9e92..d60ed99e8 100644 --- a/mesonbuild/compilers/c.py +++ b/mesonbuild/compilers/c.py @@ -309,6 +309,14 @@ class NvidiaHPC_CCompiler(PGICompiler, CCompiler): std_opt.set_versions(cppstd_choices, gnu=True) return opts + def get_option_std_args(self, target: BuildTarget, subproject: T.Optional[str] = None) -> T.List[str]: + args: T.List[str] = [] + std = self.get_compileropt_value('std', target, subproject) + assert isinstance(std, str) + if std != 'none': + args.append('-std=' + std) + return args + class ElbrusCCompiler(ElbrusCompiler, CCompiler): def __init__(self, ccache: T.List[str], exelist: T.List[str], version: str, for_machine: MachineChoice, diff --git a/mesonbuild/compilers/cpp.py b/mesonbuild/compilers/cpp.py index bdf60f6c2..5ed4aea81 100644 --- a/mesonbuild/compilers/cpp.py +++ b/mesonbuild/compilers/cpp.py @@ -572,6 +572,14 @@ class NvidiaHPC_CPPCompiler(PGICompiler, CPPCompiler): std_opt.set_versions(cppstd_choices) return opts + def get_option_std_args(self, target: BuildTarget, subproject: T.Optional[str] = None) -> T.List[str]: + args: T.List[str] = [] + std = self.get_compileropt_value('std', target, subproject) + assert isinstance(std, str) + if std != 'none': + args.append(self._find_best_cpp_std(std)) + return args + class ElbrusCPPCompiler(ElbrusCompiler, CPPCompiler): def __init__(self, ccache: T.List[str], exelist: T.List[str], version: str, for_machine: MachineChoice, |
