Revert "utils/u_math: break dependency on gallium/utils"
[mesa.git] / meson.build
index f33c596e03fcd74fb2ff687abd464f0f06d5f0c5..5e250470ed1ce14f899e0d19171ce707f6791bb0 100644 (file)
@@ -25,8 +25,8 @@ project(
     [find_program('python', 'python2', 'python3'), 'bin/meson_get_version.py']
   ).stdout(),
   license : 'MIT',
-  meson_version : '>= 0.44.1',
-  default_options : ['buildtype=debugoptimized', 'c_std=c99', 'cpp_std=c++11']
+  meson_version : '>= 0.45',
+  default_options : ['buildtype=debugoptimized', 'b_ndebug=if-release', 'c_std=c99', 'cpp_std=c++11']
 )
 
 cc = meson.get_compiler('c')
@@ -1070,6 +1070,13 @@ pre_args += '-DHAVE_ZLIB'
 dep_thread = dependency('threads')
 if dep_thread.found() and host_machine.system() != 'windows'
   pre_args += '-DHAVE_PTHREAD'
+  if cc.has_function(
+      'pthread_setaffinity_np',
+      dependencies : dep_thread,
+      prefix : '#include <pthread.h>',
+      args : '-D_GNU_SOURCE')
+    pre_args += '-DHAVE_PTHREAD_SETAFFINITY'
+  endif
 endif
 if with_amd_vk or with_gallium_radeonsi or with_gallium_r600 or with_gallium_opencl
   dep_elf = dependency('libelf', required : false)
@@ -1181,6 +1188,8 @@ else
   _llvm_version = '>= 3.3.0'
 endif
 
+_shared_llvm = get_option('shared-llvm')
+
 _llvm = get_option('llvm')
 if _llvm == 'auto'
   dep_llvm = dependency(
@@ -1189,6 +1198,7 @@ if _llvm == 'auto'
     modules : llvm_modules,
     optional_modules : llvm_optional_modules,
     required : with_amd_vk or with_gallium_radeonsi or with_gallium_swr or with_gallium_opencl,
+    static : not _shared_llvm
   )
   with_llvm = dep_llvm.found()
 elif _llvm == 'true'
@@ -1197,6 +1207,7 @@ elif _llvm == 'true'
     version : _llvm_version,
     modules : llvm_modules,
     optional_modules : llvm_optional_modules,
+    static : not _shared_llvm,
   )
   with_llvm = true
 else
@@ -1205,10 +1216,6 @@ else
 endif
 if with_llvm
   _llvm_version = dep_llvm.version().split('.')
-  # Development versions of LLVM have an 'svn' or 'git' suffix, we don't want
-  # that for our version checks.
-  # svn suffixes are stripped by meson as of 0.43, and git suffixes are
-  # strippped as of 0.44, but we support older meson versions.
 
   # 3 digits versions in LLVM only started from 3.4.1 on
   if dep_llvm.version().version_compare('>= 3.4.1')
@@ -1217,11 +1224,6 @@ if with_llvm
     _llvm_patch = '0'
   endif
 
-  if _llvm_patch.endswith('svn')
-    _llvm_patch = _llvm_patch.split('s')[0]
-  elif _llvm_patch.contains('git')
-    _llvm_patch = _llvm_patch.split('g')[0]
-  endif
   pre_args += [
     '-DHAVE_LLVM=0x0@0@0@1@'.format(_llvm_version[0], _llvm_version[1]),
     '-DMESA_LLVM_VERSION_PATCH=@0@'.format(_llvm_patch),