From 298da8a8d4c6709bd51e669310b443778c880720 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Thu, 18 Dec 2025 08:45:41 +0100 Subject: compilers: fix direction of cross-build test This used to be if for_machine is MachineChoice.BUILD and not is_cross: so it needed to be negated. This is also clearly wrong because "env.is_cross_build(for_machine)" has no effect - it is only true if for_machine is MachineChoice.HOST, in which case key.as_host() does nothing. Signed-off-by: Paolo Bonzini --- mesonbuild/compilers/detect.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mesonbuild/compilers/detect.py b/mesonbuild/compilers/detect.py index db2bdf6ab..eb42bb67e 100644 --- a/mesonbuild/compilers/detect.py +++ b/mesonbuild/compilers/detect.py @@ -701,7 +701,7 @@ def detect_cuda_compiler(env: 'Environment', for_machine: MachineChoice) -> Comp cls = CudaCompiler env.add_lang_args(cls.language, cls, for_machine) key = OptionKey('cuda_link_args', machine=for_machine) - if env.is_cross_build(for_machine): + if not env.is_cross_build(for_machine): key = key.as_host() if key in env.options: # To fix LDFLAGS issue -- cgit v1.2.3