mirror of https://github.com/nirenjan/libx52.git
Use disabler instead of checks for cmocka
parent
eddf7340f7
commit
5bf5ff02f4
11
meson.build
11
meson.build
|
|
@ -25,6 +25,9 @@ dep_systemd = dependency('systemd', required: false)
|
||||||
dep_udev = dependency('udev', required: false)
|
dep_udev = dependency('udev', required: false)
|
||||||
|
|
||||||
dep_cmocka = dependency('cmocka', required: false)
|
dep_cmocka = dependency('cmocka', required: false)
|
||||||
|
if not dep_cmocka.found()
|
||||||
|
dep_cmocka = disabler()
|
||||||
|
endif
|
||||||
|
|
||||||
doxygen_program = find_program('doxygen', required: false)
|
doxygen_program = find_program('doxygen', required: false)
|
||||||
|
|
||||||
|
|
@ -158,7 +161,6 @@ install_headers('libx52/libx52.h', subdir: meson.project_name())
|
||||||
pkgconfig.generate(lib_libx52)
|
pkgconfig.generate(lib_libx52)
|
||||||
|
|
||||||
# Unit tests for libx52
|
# Unit tests for libx52
|
||||||
if dep_cmocka.found()
|
|
||||||
libx52_string_test = executable('libx52-string-test',
|
libx52_string_test = executable('libx52-string-test',
|
||||||
'libx52/test_strings.c',
|
'libx52/test_strings.c',
|
||||||
'libx52/x52_stringify.c',
|
'libx52/x52_stringify.c',
|
||||||
|
|
@ -189,7 +191,6 @@ if dep_cmocka.found()
|
||||||
)
|
)
|
||||||
|
|
||||||
test('libx52test', libx52test, protocol: 'tap')
|
test('libx52test', libx52test, protocol: 'tap')
|
||||||
endif
|
|
||||||
|
|
||||||
# libx52io
|
# libx52io
|
||||||
libx52io_files = files(
|
libx52io_files = files(
|
||||||
|
|
@ -208,7 +209,6 @@ lib_libx52io = library('x52io', libx52io_files,
|
||||||
install_headers('libx52io/libx52io.h', subdir: meson.project_name())
|
install_headers('libx52io/libx52io.h', subdir: meson.project_name())
|
||||||
pkgconfig.generate(lib_libx52io)
|
pkgconfig.generate(lib_libx52io)
|
||||||
|
|
||||||
if dep_cmocka.found()
|
|
||||||
test_axis = executable('test-axis', 'libx52io/test_axis.c', libx52io_files,
|
test_axis = executable('test-axis', 'libx52io/test_axis.c', libx52io_files,
|
||||||
build_by_default: false,
|
build_by_default: false,
|
||||||
dependencies: [dep_cmocka, dep_hidapi],
|
dependencies: [dep_cmocka, dep_hidapi],
|
||||||
|
|
@ -220,7 +220,6 @@ if dep_cmocka.found()
|
||||||
dependencies: [dep_cmocka, dep_hidapi],
|
dependencies: [dep_cmocka, dep_hidapi],
|
||||||
)
|
)
|
||||||
test('test-parser', test_parser, protocol: 'tap')
|
test('test-parser', test_parser, protocol: 'tap')
|
||||||
endif
|
|
||||||
|
|
||||||
# libx52util
|
# libx52util
|
||||||
util_char_map = custom_target('util-char-map',
|
util_char_map = custom_target('util-char-map',
|
||||||
|
|
@ -259,7 +258,6 @@ executable('x52cli', 'cli/x52_cli.c',
|
||||||
include_directories: 'libx52',
|
include_directories: 'libx52',
|
||||||
link_with: lib_libx52)
|
link_with: lib_libx52)
|
||||||
|
|
||||||
if dep_cmocka.found()
|
|
||||||
test_cli = executable('test-cli', 'cli/x52_cli.c', 'cli/test_x52_cli.c',
|
test_cli = executable('test-cli', 'cli/x52_cli.c', 'cli/test_x52_cli.c',
|
||||||
build_by_default: false,
|
build_by_default: false,
|
||||||
c_args: ['-DX52_CLI_TESTING'],
|
c_args: ['-DX52_CLI_TESTING'],
|
||||||
|
|
@ -268,7 +266,6 @@ if dep_cmocka.found()
|
||||||
)
|
)
|
||||||
|
|
||||||
test('test-cli', test_cli, protocol: 'tap')
|
test('test-cli', test_cli, protocol: 'tap')
|
||||||
endif
|
|
||||||
|
|
||||||
# x52test
|
# x52test
|
||||||
executable('x52test',
|
executable('x52test',
|
||||||
|
|
@ -341,14 +338,12 @@ install_data('daemon/x52d.conf',
|
||||||
test('daemon-communication', files('daemon/test_daemon_comm.py')[0],
|
test('daemon-communication', files('daemon/test_daemon_comm.py')[0],
|
||||||
depends: exe_x52d, protocol: 'tap')
|
depends: exe_x52d, protocol: 'tap')
|
||||||
|
|
||||||
if dep_cmocka.found()
|
|
||||||
x52d_mouse_test_sources = ['daemon/x52d_mouse_test.c', 'daemon/x52d_mouse.c']
|
x52d_mouse_test_sources = ['daemon/x52d_mouse_test.c', 'daemon/x52d_mouse.c']
|
||||||
x52d_mouse_test = executable('x52d-mouse-test', x52d_mouse_test_sources,
|
x52d_mouse_test = executable('x52d-mouse-test', x52d_mouse_test_sources,
|
||||||
include_directories: ['.', 'libx52', 'libx52io'],
|
include_directories: ['.', 'libx52', 'libx52io'],
|
||||||
dependencies: [dep_pinelog, dep_cmocka])
|
dependencies: [dep_pinelog, dep_cmocka])
|
||||||
|
|
||||||
test('x52d-mouse-test', x52d_mouse_test, protocol: 'tap')
|
test('x52d-mouse-test', x52d_mouse_test, protocol: 'tap')
|
||||||
endif
|
|
||||||
|
|
||||||
# udev rules
|
# udev rules
|
||||||
if dep_udev.found()
|
if dep_udev.found()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue