summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2019-06-17 21:49:34 +0300
committerJussi Pakkanen <jpakkane@gmail.com>2019-06-17 21:49:34 +0300
commitf16bd54da6d2334fd6d36b0e2c2729e1cf1bdc05 (patch)
tree4984eae4ce3dc553d28412ddc03f159882f793d5
parent9933b33c553235b1ce95b8406a6660678cd3af26 (diff)
downloadmeson-cudathreads.tar.gz
Handle thread flags when not using C at all. Closes #5497.cudathreads
-rw-r--r--mesonbuild/dependencies/misc.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/mesonbuild/dependencies/misc.py b/mesonbuild/dependencies/misc.py
index af2da29b6..e5fab6459 100644
--- a/mesonbuild/dependencies/misc.py
+++ b/mesonbuild/dependencies/misc.py
@@ -388,8 +388,14 @@ class ThreadDependency(ExternalDependency):
super().__init__('threads', environment, None, kwargs)
self.name = 'threads'
self.is_found = True
- self.compile_args = self.clib_compiler.thread_flags(environment)
- self.link_args = self.clib_compiler.thread_link_flags(environment)
+ # Happens if you are using a language with threads
+ # concept without C, such as plain Cuda.
+ if self.clib_compiler is None:
+ self.compile_args = []
+ self.link_args = []
+ else:
+ self.compile_args = self.clib_compiler.thread_flags(environment)
+ self.link_args = self.clib_compiler.thread_link_flags(environment)
class Python3Dependency(ExternalDependency):