summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2025-12-18 08:45:41 +0100
committerDylan Baker <dylan@pnwbakers.com>2025-12-18 08:49:01 -0800
commit298da8a8d4c6709bd51e669310b443778c880720 (patch)
treed63ff5452b9d50230b852734c73db9f100f65915
parentcc9c037493119dc43e2910d26688957fe60b63a7 (diff)
downloadmeson-298da8a8d4c6709bd51e669310b443778c880720.tar.gz
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 <pbonzini@redhat.com>
-rw-r--r--mesonbuild/compilers/detect.py2
1 files changed, 1 insertions, 1 deletions
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