build/meson: fix x11 test/demo compilation with non-standard xcb
The x11 tests/demos did not depend on xcb and xcb-xkb directly, only indirectly through link_with: libxkbcommon_x11_internal. So linking worked, but the xcb and xcb-xkb cflags were *not* included when compiling them. So when using xcb installed in a non-standard location, what would happen is: - Library will link with custom xcb and compile with custom xcb headers. - Test will link with custom xcb and compile with system xcb headers (if exist, otherwise fail). Fixes: https://github.com/xkbcommon/libxkbcommon/issues/57 Reported-by: @remexre Signed-off-by: Ran Benita <ran234@gmail.com>master
parent
edb1c66239
commit
776cb52361
16
meson.build
16
meson.build
|
@ -284,6 +284,16 @@ test_dep = declare_dependency(
|
|||
include_directories: include_directories('src'),
|
||||
link_with: libxkbcommon_test_internal,
|
||||
)
|
||||
if get_option('enable-x11')
|
||||
x11_test_dep = declare_dependency(
|
||||
link_with: libxkbcommon_x11_internal,
|
||||
dependencies: [
|
||||
test_dep,
|
||||
xcb_dep,
|
||||
xcb_xkb_dep,
|
||||
],
|
||||
)
|
||||
endif
|
||||
test(
|
||||
'keysym',
|
||||
executable('test-keysym', 'test/keysym.c', dependencies: test_dep),
|
||||
|
@ -362,12 +372,12 @@ test(
|
|||
if get_option('enable-x11')
|
||||
test(
|
||||
'x11',
|
||||
executable('test-x11', 'test/x11.c', dependencies: test_dep, link_with: libxkbcommon_x11_internal),
|
||||
executable('test-x11', 'test/x11.c', dependencies: x11_test_dep),
|
||||
env: test_env,
|
||||
)
|
||||
# test/x11comp is meant to be run, but it is (temporarily?) disabled.
|
||||
# See: https://github.com/xkbcommon/libxkbcommon/issues/30
|
||||
executable('test-x11comp', 'test/x11comp.c', dependencies: test_dep, link_with: libxkbcommon_x11_internal)
|
||||
executable('test-x11comp', 'test/x11comp.c', dependencies: x11_test_dep)
|
||||
endif
|
||||
|
||||
|
||||
|
@ -378,7 +388,7 @@ if cc.has_header('linux/input.h')
|
|||
executable('interactive-evdev', 'test/interactive-evdev.c', dependencies: test_dep)
|
||||
endif
|
||||
if get_option('enable-x11')
|
||||
executable('interactive-x11', 'test/interactive-x11.c', dependencies: test_dep, link_with: libxkbcommon_x11_internal)
|
||||
executable('interactive-x11', 'test/interactive-x11.c', dependencies: x11_test_dep)
|
||||
endif
|
||||
if get_option('enable-wayland')
|
||||
wayland_client_dep = dependency('wayland-client', version: '>=1.2.0', required: false)
|
||||
|
|
Loading…
Reference in New Issue