Merge branch 'meson-test-dummy-link' into 'master'

Meson: Fix linking the unit tests' vendor libraries

See merge request glvnd/libglvnd!213
This commit is contained in:
Eric Engestrom 2019-12-12 23:54:38 +00:00
commit 9dcdd2807f

View file

@ -34,47 +34,27 @@ libpatchentrypoints = static_library(
prog_cp = find_program('cp')
if with_glx
libGLX_dummy = shared_module(
libGLX_dummy = shared_library(
'GLX_dummy',
['GLX_dummy.c'],
include_directories : [inc_dispatch, inc_glx, inc_include],
link_with: [libpatchentrypoints],
dependencies : [idep_trace, idep_utils_misc, dep_x11],
)
# The ICD loader expects to load a .so.0, but meson generates the .X.Y.Z
# links at install time, the build time directories only have the plain .so
# files, so we copy the .so to .so.0 so tests will work
custom_target(
'GLX_dummy.so.0',
input : [libGLX_dummy],
output : 'libGLX_dummy.so.0',
command : [prog_cp, '@INPUT@', '@OUTPUT@'],
build_by_default : true,
version : '0',
)
endif
if get_option('egl')
foreach v : ['0', '1']
_lib = shared_module(
shared_library(
'EGL_dummy' + v,
['EGL_dummy.c'],
c_args : ['-DDUMMY_VENDOR_NAME="dummy@0@"'.format(v)],
include_directories : [inc_include],
link_with: [libpatchentrypoints],
dependencies : [idep_glvnd_pthread],
version : '0',
)
set_variable('libEGL_dummy' + v, _lib)
# see The comment in the with_glx block
custom_target(
'EGL_dummy@0@.so.0'.format(v),
input : _lib,
output : 'libEGL_dummy@0@.so.0'.format(v),
command : [prog_cp, '@INPUT@', '@OUTPUT@'],
build_by_default : true,
)
endforeach
endif