Mesa (main): radv: Allow building when LLVM isn’t enabled

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Oct 1 09:05:43 UTC 2021


Module: Mesa
Branch: main
Commit: c238faf74605842d7e8d40064da28bb9dd83d933
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=c238faf74605842d7e8d40064da28bb9dd83d933

Author: Emmanuel Gil Peyrot <linkmauve at linkmauve.fr>
Date:   Fri Jul 31 16:39:10 2020 +0200

radv: Allow building when LLVM isn’t enabled

Now that ACO is considered feature-complete, it can be nice to avoid the
huge LLVM dependency when one only wants a Vulkan driver.

This patch allows radv to be built without LLVM.  The two features which
get disabled are RADV_DEBUG=llvm and shader disassembly.  The latter
is an issue for debugging, so I added a warning that this configuration
is unsupported.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11319>

---

 meson.build         | 6 ++++--
 src/amd/meson.build | 6 +++++-
 src/meson.build     | 7 ++++++-
 3 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/meson.build b/meson.build
index 22d49a5a400..13b63f8ff09 100644
--- a/meson.build
+++ b/meson.build
@@ -1711,8 +1711,10 @@ if with_llvm
       language : ['c', 'cpp'],
     )
   endif
-elif with_amd_vk or with_gallium_radeonsi or with_gallium_swr or with_swrast_vk
-  error('The following drivers require LLVM: Radv, RadeonSI, SWR, Lavapipe. One of these is enabled, but LLVM is disabled.')
+elif with_amd_vk and with_aco_tests
+  error('ACO tests require LLVM, but LLVM is disabled.')
+elif with_gallium_radeonsi or with_gallium_swr or with_swrast_vk
+  error('The following drivers require LLVM: RadeonSI, SWR, Lavapipe. One of these is enabled, but LLVM is disabled.')
 elif with_gallium_opencl
   error('The OpenCL "Clover" state tracker requires LLVM, but LLVM is disabled.')
 elif with_clc
diff --git a/src/amd/meson.build b/src/amd/meson.build
index 4a27c8c3e4a..463c78544ab 100644
--- a/src/amd/meson.build
+++ b/src/amd/meson.build
@@ -22,7 +22,11 @@ inc_amd = include_directories('.')
 
 subdir('addrlib')
 subdir('common')
-subdir('llvm')
+if with_llvm
+  subdir('llvm')
+else
+  libamd_common_llvm = []
+endif
 if with_amd_vk
   subdir('compiler')
   subdir('vulkan')
diff --git a/src/meson.build b/src/meson.build
index d99522cfd2c..5a4d329db0c 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -24,11 +24,16 @@ inc_src = include_directories('.')
 inc_gallium = include_directories('gallium/include')
 inc_gallium_aux = include_directories('gallium/auxiliary')
 inc_amd_common = include_directories('amd/common')
-inc_amd_common_llvm = include_directories('amd/llvm')
 inc_tool = include_directories('tool')
 pps_datasources = []
 pps_includes = []
 
+if with_llvm
+  inc_amd_common_llvm = include_directories('amd/llvm')
+else
+  inc_amd_common_llvm = []
+endif
+
 libglsl_util = static_library(
   'glsl_util',
   files(



More information about the mesa-commit mailing list