aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/environment.py
diff options
context:
space:
mode:
Diffstat (limited to 'mesonbuild/environment.py')
-rw-r--r--mesonbuild/environment.py29
1 files changed, 19 insertions, 10 deletions
diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py
index 26727ad..cc726ce 100644
--- a/mesonbuild/environment.py
+++ b/mesonbuild/environment.py
@@ -819,7 +819,8 @@ class Environment:
_, o, e = Popen_safe(compiler + check_args)
v = search_version(o)
if o.startswith('LLD'):
- linker = LLVMDynamicLinker(compiler, for_machine, 'lld', comp_class.LINKER_PREFIX, override, version=v) # type: DynamicLinker
+ linker = LLVMDynamicLinker(
+ compiler, for_machine, 'lld', comp_class.LINKER_PREFIX, override, version=v) # type: DynamicLinker
elif e.startswith('lld-link: '):
# Toolchain wrapper got in the way; this happens with e.g. https://github.com/mstorsjo/llvm-mingw
# Let's try to extract the linker invocation command to grab the version.
@@ -963,7 +964,7 @@ class Environment:
version = search_version(arm_ver_str)
full_version = arm_ver_str
cls = ArmclangCCompiler if lang == 'c' else ArmclangCPPCompiler
- linker = ArmClangDynamicLinker(for_machine, [], version=version)
+ linker = ArmClangDynamicLinker(for_machine, version=version)
return cls(
ccache + compiler, version, for_machine, is_cross, info,
exe_wrap, full_version=full_version, linker=linker)
@@ -1010,11 +1011,13 @@ class Environment:
return cls(
ccache + compiler, version, for_machine, is_cross, info,
exe_wrap, full_version=full_version, linker=linker)
+
if 'Intel(R) C++ Intel(R)' in err:
version = search_version(err)
target = 'x86' if 'IA-32' in err else 'x86_64'
cls = IntelClCCompiler if lang == 'c' else IntelClCPPCompiler
- linker = XilinkDynamicLinker(for_machine, version=version)
+ self.coredata.add_lang_args(cls.language, cls, for_machine, self)
+ linker = XilinkDynamicLinker(for_machine, [], version=version)
return cls(
compiler, version, for_machine, is_cross, info=info,
exe_wrap=exe_wrap, target=target, linker=linker)
@@ -1044,6 +1047,7 @@ class Environment:
target, linker=linker)
if 'PGI Compilers' in out:
cls = PGICCompiler if lang == 'c' else PGICPPCompiler
+ self.coredata.add_lang_args(cls.language, cls, for_machine, self)
linker = PGIDynamicLinker(compiler, for_machine, 'pgi', cls.LINKER_PREFIX, [], version=version)
return cls(
ccache + compiler, version, for_machine, is_cross,
@@ -1111,8 +1115,10 @@ class Environment:
# the full version:
version = out.strip().split('V')[-1]
cpp_compiler = self.detect_cpp_compiler(for_machine)
- linker = CudaLinker(compiler, for_machine, 'nvlink', CudaCompiler.LINKER_PREFIX, version=CudaLinker.parse_version())
- return CudaCompiler(ccache + compiler, version, for_machine, is_cross, exe_wrap, host_compiler=cpp_compiler, info=info, linker=linker)
+ cls = CudaCompiler
+ self.coredata.add_lang_args(cls.language, cls, for_machine, self)
+ linker = CudaLinker(compiler, for_machine, 'nvlink', CudaCompiler.LINKER_PREFIX, [], version=CudaLinker.parse_version())
+ return cls(ccache + compiler, version, for_machine, is_cross, exe_wrap, host_compiler=cpp_compiler, info=info, linker=linker)
raise EnvironmentException('Could not find suitable CUDA compiler: "' + ' '.join(compilers) + '"')
def detect_fortran_compiler(self, for_machine: MachineChoice):
@@ -1175,8 +1181,10 @@ class Environment:
if 'Intel(R) Visual Fortran' in err:
version = search_version(err)
target = 'x86' if 'IA-32' in err else 'x86_64'
+ cls = IntelClFortranCompiler
+ self.coredata.add_lang_args(cls.language, cls, for_machine, self)
linker = XilinkDynamicLinker(for_machine, [], version=version)
- return IntelClFortranCompiler(
+ return cls(
compiler, version, for_machine, is_cross, target,
info, exe_wrap, linker=linker)
@@ -1192,10 +1200,11 @@ class Environment:
exe_wrap, full_version=full_version)
if 'PGI Compilers' in out:
- linker = PGIDynamicLinker(
- compiler, for_machine, 'pgi',
- PGIFortranCompiler.LINKER_PREFIX, version=version)
- return PGIFortranCompiler(
+ cls = PGIFortranCompiler
+ self.coredata.add_lang_args(cls.language, cls, for_machine, self)
+ linker = PGIDynamicLinker(compiler, for_machine, 'pgi',
+ cls.LINKER_PREFIX, [], version=version)
+ return cls(
compiler, version, for_machine, is_cross, info, exe_wrap,
full_version=full_version, linker=linker)