From 07777e15d47dbddaf849d24b3a30c85745c533ca Mon Sep 17 00:00:00 2001 From: John Ericson Date: Thu, 4 Oct 2018 20:52:08 -0400 Subject: Purge `is_cross` and friends without changing user interfaces In most cases instead pass `for_machine`, the name of the relevant machines (what compilers target, what targets run on, etc). This allows us to use the cross code path in the native case, deduplicating the code. As one can see, environment got bigger as more information is kept structured there, while ninjabackend got a smaller. Overall a few amount of lines were added, but the hope is what's added is a lot simpler than what's removed. --- mesonbuild/compilers/cuda.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'mesonbuild/compilers/cuda.py') diff --git a/mesonbuild/compilers/cuda.py b/mesonbuild/compilers/cuda.py index 51a1300..3c38c09 100644 --- a/mesonbuild/compilers/cuda.py +++ b/mesonbuild/compilers/cuda.py @@ -15,15 +15,15 @@ import re, os.path from .. import mlog -from ..mesonlib import EnvironmentException, Popen_safe +from ..mesonlib import EnvironmentException, MachineChoice, Popen_safe from .compilers import (Compiler, cuda_buildtype_args, cuda_optimization_args, cuda_debug_args, CompilerType, get_gcc_soname_args) class CudaCompiler(Compiler): - def __init__(self, exelist, version, is_cross, exe_wrapper=None): + def __init__(self, exelist, version, for_machine: MachineChoice, is_cross, exe_wrapper=None): if not hasattr(self, 'language'): self.language = 'cuda' - super().__init__(exelist, version) + super().__init__(exelist, version, for_machine) self.is_cross = is_cross self.exe_wrapper = exe_wrapper self.id = 'nvcc' -- cgit v1.1