diff options
author | David Seifert <soap@gentoo.org> | 2023-08-22 18:34:02 +0200 |
---|---|---|
committer | Eli Schwartz <eschwartz93@gmail.com> | 2023-08-23 18:39:30 -0400 |
commit | 078dc2ca101f3fea115471d1a488c72fbd80c065 (patch) | |
tree | d62e1cf41a68f46bd09b1e621c971a014e17b856 /mesonbuild | |
parent | 18b96cd0692255b30f8f0597cbf4af89d142a93d (diff) | |
download | meson-078dc2ca101f3fea115471d1a488c72fbd80c065.zip meson-078dc2ca101f3fea115471d1a488c72fbd80c065.tar.gz meson-078dc2ca101f3fea115471d1a488c72fbd80c065.tar.bz2 |
Fix completely broken support for `static: true` with dependency('cuda')
Diffstat (limited to 'mesonbuild')
-rw-r--r-- | mesonbuild/dependencies/cuda.py | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/mesonbuild/dependencies/cuda.py b/mesonbuild/dependencies/cuda.py index e16808b..45df11b 100644 --- a/mesonbuild/dependencies/cuda.py +++ b/mesonbuild/dependencies/cuda.py @@ -45,8 +45,16 @@ class CudaDependency(SystemDependency): super().__init__('cuda', environment, kwargs, language=language) self.lib_modules: T.Dict[str, T.List[str]] = {} self.requested_modules = self.get_requested(kwargs) - if 'cudart' not in self.requested_modules: - self.requested_modules = ['cudart'] + self.requested_modules + if not any(runtime in self.requested_modules for runtime in ['cudart', 'cudart_static']): + req_modules = ['cudart'] + if kwargs.get('static', False): + req_modules = ['cudart_static'] + machine = self.env.machines[self.for_machine] + if machine.is_linux(): + # extracted by running + # nvcc -v foo.o + req_modules += ['rt', 'pthread', 'dl'] + self.requested_modules = req_modules + self.requested_modules (self.cuda_path, self.version, self.is_found) = self._detect_cuda_path_and_version() if not self.is_found: |