meson: don't require libelf for r600 without LLVM
authorDylan Baker <dylan@pnwbakers.com>
Mon, 22 Oct 2018 14:26:44 +0000 (07:26 -0700)
committerDylan Baker <dylan@pnwbakers.com>
Mon, 22 Oct 2018 18:29:55 +0000 (11:29 -0700)
r600 doesn't have a hard requirement on LLVM, and therefore doesn't have
a hard requirement on libelf. Currently the logic doesn't allow that
however.

Distro-bug: https://bugs.gentoo.org/669058
Fixes: 5060c51b6f4dfb0d5358bde6523285163d3faaad
       ("meson: build r600 driver")
Reviewed-by: Matt Turner <mattst88@gmail.com>
meson.build

index 0dfe09858bf9640a8190a5ab0dce78c4358d0f0c..712210f0f1ba966d6df806a236cf5cb03fc60394 100644 (file)
@@ -1086,14 +1086,6 @@ if dep_thread.found() and host_machine.system() != 'windows'
     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)
-  if not dep_elf.found()
-    dep_elf = cc.find_library('elf')
-  endif
-else
-  dep_elf = null_dep
-endif
 dep_expat = dependency('expat')
 # this only exists on linux so either this is linux and it will be found, or
 # its not linux and and wont
@@ -1240,6 +1232,16 @@ elif with_amd_vk or with_gallium_radeonsi or with_gallium_swr
   error('The following drivers require LLVM: Radv, RadeonSI, SWR. One of these is enabled, but LLVM is disabled.')
 endif
 
+if (with_amd_vk or with_gallium_radeonsi or with_gallium_opencl or
+    (with_gallium_r600 and with_llvm))
+  dep_elf = dependency('libelf', required : false)
+  if not dep_elf.found()
+    dep_elf = cc.find_library('elf')
+  endif
+else
+  dep_elf = null_dep
+endif
+
 dep_glvnd = null_dep
 if with_glvnd
   dep_glvnd = dependency('libglvnd', version : '>= 0.2.0')