5500.patch 1.3 KB

12345678910111213141516171819202122232425262728293031
  1. From f16bd54da6d2334fd6d36b0e2c2729e1cf1bdc05 Mon Sep 17 00:00:00 2001
  2. From: Jussi Pakkanen <jpakkane@gmail.com>
  3. Date: Mon, 17 Jun 2019 21:49:34 +0300
  4. Subject: [PATCH] Handle thread flags when not using C at all. Closes #5497.
  5. ---
  6. mesonbuild/dependencies/misc.py | 10 ++++++++--
  7. 1 file changed, 8 insertions(+), 2 deletions(-)
  8. diff --git a/mesonbuild/dependencies/misc.py b/mesonbuild/dependencies/misc.py
  9. index af2da29b63..e5fab64599 100644
  10. --- a/mesonbuild/dependencies/misc.py
  11. +++ b/mesonbuild/dependencies/misc.py
  12. @@ -388,8 +388,14 @@ def __init__(self, environment, kwargs):
  13. super().__init__('threads', environment, None, kwargs)
  14. self.name = 'threads'
  15. self.is_found = True
  16. - self.compile_args = self.clib_compiler.thread_flags(environment)
  17. - self.link_args = self.clib_compiler.thread_link_flags(environment)
  18. + # Happens if you are using a language with threads
  19. + # concept without C, such as plain Cuda.
  20. + if self.clib_compiler is None:
  21. + self.compile_args = []
  22. + self.link_args = []
  23. + else:
  24. + self.compile_args = self.clib_compiler.thread_flags(environment)
  25. + self.link_args = self.clib_compiler.thread_link_flags(environment)
  26. class Python3Dependency(ExternalDependency):