From 9e09c85e6cf9ef3676bc8890ce0d7ce1440b4bf0 Mon Sep 17 00:00:00 2001 From: Jussi Pakkanen Date: Mon, 17 Jun 2019 21:49:34 +0300 Subject: [PATCH] Handle thread flags when not using C at all. Closes #5497. --- mesonbuild/dependencies/misc.py | 10 ++++++++-- 1 file 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):