diff options
| author | David Seifert <soap@gentoo.org> | 2024-05-22 15:55:55 +0200 |
|---|---|---|
| committer | Jussi Pakkanen <jpakkane@gmail.com> | 2024-05-22 23:54:30 +0300 |
| commit | 4861079360423298b7c282becab46bdcdee8f8f6 (patch) | |
| tree | d4a37ad7e67a44bd8844cbb893be3ed9f45a4088 /mesonbuild/compilers | |
| parent | 4c6d370a0ea5e705c32ee50bb06b1ca7d42b3548 (diff) | |
| download | meson-4861079360423298b7c282becab46bdcdee8f8f6.tar.gz | |
cuda: fix `cuda.find_library()` hardcoded to yield true
* Previously, cuda would just plainly prepend `-l` to the libname.
* By relying on the host compiler to find libraries, we now get
more subtle failures, such as CUDA modules not being found
anymore.
* We need to simplify these CUDA modules when nvcc is used for
linking, since this may have side-effects from the cuda toolchain.
Closes: #13240
Diffstat (limited to 'mesonbuild/compilers')
| -rw-r--r-- | mesonbuild/compilers/compilers.py | 2 | ||||
| -rw-r--r-- | mesonbuild/compilers/cuda.py | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/mesonbuild/compilers/compilers.py b/mesonbuild/compilers/compilers.py index 44b998a67..673b63f9d 100644 --- a/mesonbuild/compilers/compilers.py +++ b/mesonbuild/compilers/compilers.py @@ -1046,7 +1046,7 @@ class Compiler(HoldableObject, metaclass=abc.ABCMeta): return dep.get_compile_args() def get_dependency_link_args(self, dep: 'Dependency') -> T.List[str]: - return dep.get_link_args() + return dep.get_link_args(self.get_language()) @classmethod def use_linker_args(cls, linker: str, version: str) -> T.List[str]: diff --git a/mesonbuild/compilers/cuda.py b/mesonbuild/compilers/cuda.py index 3761019b9..7231a267c 100644 --- a/mesonbuild/compilers/cuda.py +++ b/mesonbuild/compilers/cuda.py @@ -768,7 +768,7 @@ class CudaCompiler(Compiler): def find_library(self, libname: str, env: 'Environment', extra_dirs: T.List[str], libtype: LibType = LibType.PREFER_SHARED, lib_prefix_warning: bool = True) -> T.Optional[T.List[str]]: - return ['-l' + libname] # FIXME + return self.host_compiler.find_library(libname, env, extra_dirs, libtype, lib_prefix_warning) def get_crt_compile_args(self, crt_val: str, buildtype: str) -> T.List[str]: return self._to_host_flags(self.host_compiler.get_crt_compile_args(crt_val, buildtype)) |
