[Mesa-stable] [PATCH] meson: gallium: add idep_nir dependency where it's used

Emil Velikov emil.l.velikov at gmail.com
Fri Feb 16 17:19:53 UTC 2018


From: Emil Velikov <emil.velikov at collabora.com>

Currently there are two type of users of NIR (and hence idep_nir):
 - gallium/aux - via tgsi_to_nir.c
 - drivers - freedreno, radeonsi, vc4, vc5

Of the above, the aux. module and freedreno were missing the idep_nir.
Adjust as needed and document.

To catch the fallout, consider the following:
 - build only drivers that do not use NIR - say nouveau
 - build target that does not pull libmesa_gallium - since that pulls
libglsl and thus libnir
 - disable the linker garbage collector - since it would otherwise
discard tgsi_to_nir.c
 - observe the link-time errors, since the NIR references pulled by
tgsi_to_nir.c are unresolved.

Cc: 18.0 <mesa-stable at lists.freedesktop.org>
Cc: Dylan Baker <dylan.c.baker at intel.com>
Signed-off-by: Emil Velikov <emil.velikov at collabora.com>
---
This is a part of a larger WIP, although it also makes sense on its own.

 src/gallium/auxiliary/meson.build         | 2 +-
 src/gallium/drivers/freedreno/meson.build | 2 ++
 src/gallium/drivers/radeonsi/meson.build  | 1 +
 src/gallium/drivers/vc4/meson.build       | 1 +
 src/gallium/drivers/vc5/meson.build       | 1 +
 5 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/gallium/auxiliary/meson.build b/src/gallium/auxiliary/meson.build
index 6f1542d7ade..605c260f64d 100644
--- a/src/gallium/auxiliary/meson.build
+++ b/src/gallium/auxiliary/meson.build
@@ -498,7 +498,7 @@ libgallium = static_library(
   cpp_args : [cpp_vis_args, cpp_msvc_compat_args],
   dependencies : [
     dep_libdrm, dep_llvm, dep_unwind, dep_dl, dep_m, dep_thread, dep_lmsensors,
-    idep_nir_headers,
+    idep_nir,
   ],
   build_by_default : false,
 )
diff --git a/src/gallium/drivers/freedreno/meson.build b/src/gallium/drivers/freedreno/meson.build
index ef70cc08c74..0d8a5908c40 100644
--- a/src/gallium/drivers/freedreno/meson.build
+++ b/src/gallium/drivers/freedreno/meson.build
@@ -231,6 +231,8 @@ libfreedreno = static_library(
 driver_freedreno = declare_dependency(
   compile_args : '-DGALLIUM_FREEDRENO',
   link_with : [libfreedrenowinsys, libfreedreno],
+  # NIR dependency is also resolved via libgallium
+  dependencies : idep_nir,
 )
 
 ir3_compiler = executable(
diff --git a/src/gallium/drivers/radeonsi/meson.build b/src/gallium/drivers/radeonsi/meson.build
index 9a62d143088..cb5964256bc 100644
--- a/src/gallium/drivers/radeonsi/meson.build
+++ b/src/gallium/drivers/radeonsi/meson.build
@@ -86,5 +86,6 @@ driver_radeonsi = declare_dependency(
   link_with : [
     libradeonsi, libradeon, libradeonwinsys, libamdgpuwinsys, libamd_common,
   ],
+  # NIR dependency is also resolved via libgallium
   dependencies : idep_nir,
 )
diff --git a/src/gallium/drivers/vc4/meson.build b/src/gallium/drivers/vc4/meson.build
index ef7e7bcac5c..68f1d7d05e8 100644
--- a/src/gallium/drivers/vc4/meson.build
+++ b/src/gallium/drivers/vc4/meson.build
@@ -116,5 +116,6 @@ libvc4 = static_library(
 driver_vc4 = declare_dependency(
   compile_args : '-DGALLIUM_VC4',
   link_with : [libvc4, libvc4winsys, libbroadcom_cle],
+  # NIR dependency is also resolved via libgallium
   dependencies : idep_nir,
 )
diff --git a/src/gallium/drivers/vc5/meson.build b/src/gallium/drivers/vc5/meson.build
index 005bf2f9b8e..3d2b7ad9be9 100644
--- a/src/gallium/drivers/vc5/meson.build
+++ b/src/gallium/drivers/vc5/meson.build
@@ -91,5 +91,6 @@ libvc5 = static_library(
 driver_vc5 = declare_dependency(
   compile_args : '-DGALLIUM_VC5',
   link_with : [libvc5, libvc5winsys, libbroadcom_cle, libbroadcom_vc5],
+  # NIR dependency is also resolved via libgallium
   dependencies : idep_nir,
 )
-- 
2.16.0



More information about the mesa-stable mailing list