Mesa (main): meson: make mesa/tests/glx depend on gallium

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Dec 7 13:47:27 UTC 2021


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

Author: Dave Airlie <airlied at redhat.com>
Date:   Tue Dec  7 14:29:29 2021 +1000

meson: make mesa/tests/glx depend on gallium

If I start direct linking the state tracker to mesa, the tests fail
to build because they don't have gallium linked.

Reviewed-by: Dylan Baker <dylan.c.baker at intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14073>

---

 src/mesa/main/tests/meson.build |  2 +-
 src/mesa/meson.build            |  3 ---
 src/meson.build                 | 11 +++++++----
 3 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/src/mesa/main/tests/meson.build b/src/mesa/main/tests/meson.build
index ce924251cc1..47ad17af343 100644
--- a/src/mesa/main/tests/meson.build
+++ b/src/mesa/main/tests/meson.build
@@ -39,7 +39,7 @@ test(
     [files_main_test, main_dispatch_h],
     include_directories : [inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium],
     dependencies : [idep_gtest, dep_clock, dep_dl, dep_thread, idep_mesautil],
-    link_with : [libmesa, link_main_test],
+    link_with : [libmesa, libgallium, link_main_test],
   ),
   suite : ['mesa'],
   protocol : gtest_test_protocol,
diff --git a/src/mesa/meson.build b/src/mesa/meson.build
index aef1f8fdc46..3774092527a 100644
--- a/src/mesa/meson.build
+++ b/src/mesa/meson.build
@@ -580,6 +580,3 @@ libmesa = static_library(
   build_by_default : false,
 )
 
-if with_tests
-  subdir('main/tests')
-endif
diff --git a/src/meson.build b/src/meson.build
index 5bfa89b4825..7cbbf74af78 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -109,23 +109,26 @@ endif
 if with_gallium_asahi or with_tools.contains('asahi')
   subdir('asahi')
 endif
-subdir('mesa')
 subdir('loader')
 if with_platform_haiku
   subdir('hgl')
 endif
-if with_glx == 'dri'
-  subdir('glx')
-endif
 if with_gbm
   subdir('gbm')
 else
   inc_gbm = []
 endif
 if with_gallium
+  subdir('mesa')
   subdir('gallium')
+  if with_glx == 'dri'
+     subdir('glx')
+  endif
   # This has to be here since it requires libgallium, and subdir cannot
   # contain ..
+  if with_tests
+    subdir('mesa/main/tests')
+  endif
   if with_tests and with_shared_glapi
     subdir('mesa/state_tracker/tests')
   endif



More information about the mesa-commit mailing list