[Mesa-dev] [PATCH mesa] meson: fix vulkan only build with tests

Eric Engestrom eric.engestrom at intel.com
Fri Oct 5 12:19:34 UTC 2018


Fixes the build for
$ meson -D dri-drivers=[] -D gallium-drivers=[] -D build-tests=true

Compiling all this unused code isn't an actual problem, until you also
try to build the tests, at which point you get this:

  [213/705] Linking target src/mapi/glapi/glapi_static_check_table.
  FAILED: src/mapi/glapi/glapi_static_check_table
  ccache c++  -o src/mapi/glapi/glapi_static_check_table 'src/mapi/glapi/src at mapi@glapi@@glapi_static_check_table at exe/tests_check_table.cpp.o' -Wl,--no-undefined -Wl,--as-needed -Wl,--start-group src/mapi/glapi/libglapi_static.a src/gtest/libgtest.a -Wl,--end-group -pthread '-Wl,-rpath,$ORIGIN/:$ORIGIN/../../gtest' -Wl,-rpath-link,/tmp/tmp.qyVZB5kQIB/mesa/build/src/mapi/glapi:/tmp/tmp.qyVZB5kQIB/mesa/build/src/gtest
  /usr/bin/ld: src/mapi/glapi/libglapi_static.a(glapi_getproc.c.o):(.data.rel.ro+0x8810): undefined reference to `gl_dispatch_stub_343'
  /usr/bin/ld: src/mapi/glapi/libglapi_static.a(glapi_getproc.c.o):(.data.rel.ro+0x8828): undefined reference to `gl_dispatch_stub_343'
  /usr/bin/ld: src/mapi/glapi/libglapi_static.a(glapi_getproc.c.o):(.data.rel.ro+0x8840): undefined reference to `gl_dispatch_stub_344'
  /usr/bin/ld: src/mapi/glapi/libglapi_static.a(glapi_getproc.c.o):(.data.rel.ro+0x8858): undefined reference to `gl_dispatch_stub_344'
  /usr/bin/ld: src/mapi/glapi/libglapi_static.a(glapi_getproc.c.o):(.data.rel.ro+0x8870): undefined reference to `gl_dispatch_stub_345'
  /usr/bin/ld: src/mapi/glapi/libglapi_static.a(glapi_getproc.c.o):(.data.rel.ro+0x8888): undefined reference to `gl_dispatch_stub_345'
  collect2: error: ld returned 1 exit status
  ninja: build stopped: subcommand failed.

Signed-off-by: Eric Engestrom <eric.engestrom at intel.com>
---
 src/meson.build | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/meson.build b/src/meson.build
index 89ffaddf47b7286e4fe0..bde0e2aaca07931d3097 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -51,7 +51,9 @@ idep_git_sha1 = declare_dependency(
 
 subdir('gtest')
 subdir('util')
-subdir('mapi')
+if with_gles1 or with_gles2 or with_shared_glapi
+  subdir('mapi')
+endif
 # TODO: opengl
 subdir('compiler')
 subdir('egl/wayland/wayland-drm')
@@ -65,7 +67,9 @@ endif
 if with_dri_i965 or with_intel_vk
   subdir('intel')
 endif
-subdir('mesa')
+if with_opengl or with_gles1 or with_gles2 or with_shared_glapi
+  subdir('mesa')
+endif
 subdir('loader')
 if with_platform_haiku
   subdir('hgl')
-- 
Cheers,
  Eric



More information about the mesa-dev mailing list