diff options
| author | Dylan Baker <dylan@pnwbakers.com> | 2025-02-27 08:29:56 +0100 |
|---|---|---|
| committer | Eli Schwartz <eschwartz93@gmail.com> | 2025-03-09 18:06:14 -0400 |
| commit | 35ebae55412feed9d91e78138e02f0cf42681d65 (patch) | |
| tree | e07c3d521225394db8295b9b19a17032ea27321a | |
| parent | f39637e1648060bddcdd4372983b8d9ca844caf9 (diff) | |
| download | meson-35ebae55412feed9d91e78138e02f0cf42681d65.tar.gz | |
compilers/cuda: implement has_argument checks
Same as the preceding commit, the CUDA toolchain does not yet know to
perform compile checks for multiple arguments. Backfill required
functions.
| -rw-r--r-- | mesonbuild/compilers/cuda.py | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/mesonbuild/compilers/cuda.py b/mesonbuild/compilers/cuda.py index 284f28486..b987a9bb2 100644 --- a/mesonbuild/compilers/cuda.py +++ b/mesonbuild/compilers/cuda.py @@ -1,5 +1,6 @@ # SPDX-License-Identifier: Apache-2.0 # Copyright 2012-2017 The Meson development team +# Copyright © 2024 Intel Corporation from __future__ import annotations @@ -14,10 +15,9 @@ from ..mesonlib import ( EnvironmentException, Popen_safe, is_windows, LibType, version_compare ) -from .compilers import Compiler +from .compilers import Compiler, CompileCheckMode if T.TYPE_CHECKING: - from .compilers import CompileCheckMode from ..build import BuildTarget from ..coredata import MutableKeyedOptionDictType from ..dependencies import Dependency @@ -812,3 +812,11 @@ class CudaCompiler(Compiler): def get_assert_args(self, disable: bool, env: 'Environment') -> T.List[str]: return self.host_compiler.get_assert_args(disable, env) + + def has_multi_arguments(self, args: T.List[str], env: Environment) -> T.Tuple[bool, bool]: + args = self._to_host_flags(args) + return self.compiles('int main(void) { return 0; }', env, extra_args=args, mode=CompileCheckMode.COMPILE) + + def has_multi_link_arguments(self, args: T.List[str], env: Environment) -> T.Tuple[bool, bool]: + args = self._to_host_flags(self.linker.fatal_warnings() + args, phase=Phase.LINKER) + return self.compiles('int main(void) { return 0; }', env, extra_args=args, mode=CompileCheckMode.LINK) |
