mirror of https://github.com/nirenjan/libx52.git
Move meson files into subdirectories
parent
5bf5ff02f4
commit
41d927504e
|
@ -1,2 +1,2 @@
|
||||||
/version-info ident
|
/version-info ident
|
||||||
/meson.build ident
|
meson.build ident
|
||||||
|
|
|
@ -0,0 +1,58 @@
|
||||||
|
#######################################################################
|
||||||
|
# Version information
|
||||||
|
#######################################################################
|
||||||
|
compiler_version = run_command(compiler.cmd_array(), '--version',
|
||||||
|
capture: true,
|
||||||
|
check: true).stdout().split('\n')[0]
|
||||||
|
|
||||||
|
build_date = run_command('date', '+%Y-%m-%dT%H:%M:%S%z',
|
||||||
|
capture: true,
|
||||||
|
check: true).stdout().strip()
|
||||||
|
|
||||||
|
build_host = run_command('uname', '-a',
|
||||||
|
capture: true,
|
||||||
|
check: true).stdout().strip()
|
||||||
|
|
||||||
|
built_for = '@0@ @1@ @2@-endian'.format(
|
||||||
|
host_machine.system(),
|
||||||
|
host_machine.cpu(),
|
||||||
|
host_machine.endian(),
|
||||||
|
)
|
||||||
|
|
||||||
|
git = find_program('git', required: false)
|
||||||
|
if git.found()
|
||||||
|
vcs_describe = run_command(git, 'describe', '--dirty',
|
||||||
|
capture: true,
|
||||||
|
check: false).stdout().strip()
|
||||||
|
if vcs_describe == ''
|
||||||
|
vcs_describe = meson.project_version()
|
||||||
|
endif
|
||||||
|
else
|
||||||
|
vcs_describe = meson.project_version()
|
||||||
|
endif
|
||||||
|
|
||||||
|
version_data = configuration_data()
|
||||||
|
version_data.set_quoted('BUILD_VERSION', vcs_describe)
|
||||||
|
version_data.set_quoted('BUILD_DATE', build_date)
|
||||||
|
version_data.set_quoted('BUILD_HOST', build_host)
|
||||||
|
version_data.set_quoted('BUILD_COMPILER', compiler_version)
|
||||||
|
version_data.set_quoted('BUILD_TARGET', built_for)
|
||||||
|
version_data.set_quoted('BUILD_VERSION_INFO_IDENT', '$Id: 1fa3db9a6ccf7a84723ee4cb69fd3eac1b1f57e6 $')
|
||||||
|
|
||||||
|
version_info_h = configure_file(
|
||||||
|
input: 'version-info.h.meson',
|
||||||
|
output: 'version-info.h',
|
||||||
|
configuration: version_data
|
||||||
|
)
|
||||||
|
|
||||||
|
# x52bugreport
|
||||||
|
exe_bugreport = executable('x52bugreport', 'bugreport.c',
|
||||||
|
install: true,
|
||||||
|
include_directories: [includes],
|
||||||
|
dependencies: [dep_libusb, dep_hidapi],
|
||||||
|
link_with: [lib_libx52io])
|
||||||
|
|
||||||
|
# Test only to get code coverage
|
||||||
|
test('x52bugreport', exe_bugreport, protocol:'exitcode')
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,16 @@
|
||||||
|
# x52cli
|
||||||
|
executable('x52cli', 'x52_cli.c',
|
||||||
|
install: true,
|
||||||
|
include_directories: [includes],
|
||||||
|
link_with: lib_libx52)
|
||||||
|
|
||||||
|
test_cli = executable('test-cli', 'x52_cli.c', 'test_x52_cli.c',
|
||||||
|
build_by_default: false,
|
||||||
|
c_args: ['-DX52_CLI_TESTING'],
|
||||||
|
include_directories: [includes],
|
||||||
|
dependencies: [dep_cmocka],
|
||||||
|
)
|
||||||
|
|
||||||
|
test('test-cli', test_cli, protocol: 'tap')
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,62 @@
|
||||||
|
# x52d
|
||||||
|
libx52dcomm_sources = [
|
||||||
|
'x52d_comm_client.c',
|
||||||
|
'x52d_comm_internal.c'
|
||||||
|
]
|
||||||
|
|
||||||
|
install_headers('x52dcomm.h', subdir: meson.project_name())
|
||||||
|
|
||||||
|
lib_libx52dcomm = library('x52dcomm', libx52dcomm_sources,
|
||||||
|
include_directories: includes)
|
||||||
|
|
||||||
|
x52d_sources = [
|
||||||
|
'x52d_main.c',
|
||||||
|
'x52d_config_parser.c',
|
||||||
|
'x52d_config_dump.c',
|
||||||
|
'x52d_config.c',
|
||||||
|
'x52d_device.c',
|
||||||
|
'x52d_client.c',
|
||||||
|
'x52d_clock.c',
|
||||||
|
'x52d_mouse.c',
|
||||||
|
'x52d_notify.c',
|
||||||
|
'x52d_led.c',
|
||||||
|
'x52d_command.c',
|
||||||
|
]
|
||||||
|
|
||||||
|
dep_threads = dependency('threads')
|
||||||
|
x52d_linkwith = [lib_libx52, lib_libx52dcomm]
|
||||||
|
x52d_deps = [dep_pinelog, dep_inih, dep_threads]
|
||||||
|
x52d_cflags = []
|
||||||
|
if dep_evdev.found()
|
||||||
|
x52d_sources += 'x52d_io.c'
|
||||||
|
x52d_sources += 'x52d_mouse_evdev.c'
|
||||||
|
x52d_cflags += '-DHAVE_EVDEV'
|
||||||
|
x52d_linkwith += lib_libx52io
|
||||||
|
x52d_deps += dep_evdev
|
||||||
|
endif
|
||||||
|
|
||||||
|
exe_x52d = executable('x52d', x52d_sources,
|
||||||
|
install: true,
|
||||||
|
include_directories: includes,
|
||||||
|
c_args: x52d_cflags,
|
||||||
|
dependencies: x52d_deps,
|
||||||
|
link_with: x52d_linkwith)
|
||||||
|
|
||||||
|
executable('x52ctl', 'x52ctl.c',
|
||||||
|
install: true,
|
||||||
|
include_directories: includes,
|
||||||
|
link_with: lib_libx52dcomm)
|
||||||
|
|
||||||
|
install_data('x52d.conf',
|
||||||
|
install_dir: join_paths(get_option('sysconfdir'), 'x52d'))
|
||||||
|
|
||||||
|
test('daemon-communication', files('test_daemon_comm.py')[0],
|
||||||
|
depends: exe_x52d, protocol: 'tap')
|
||||||
|
|
||||||
|
x52d_mouse_test_sources = ['x52d_mouse_test.c', 'x52d_mouse.c']
|
||||||
|
x52d_mouse_test = executable('x52d-mouse-test', x52d_mouse_test_sources,
|
||||||
|
include_directories: includes,
|
||||||
|
dependencies: [dep_pinelog, dep_cmocka])
|
||||||
|
|
||||||
|
test('x52d-mouse-test', x52d_mouse_test, protocol: 'tap')
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
# x52evtest
|
||||||
|
executable('x52evtest', 'ev_test.c',
|
||||||
|
install: true,
|
||||||
|
include_directories: includes,
|
||||||
|
link_with: [lib_libx52io])
|
|
@ -0,0 +1,9 @@
|
||||||
|
# x52test
|
||||||
|
executable('x52test',
|
||||||
|
'x52_test.c',
|
||||||
|
'x52_test_mfd.c',
|
||||||
|
'x52_test_led.c',
|
||||||
|
'x52_test_clock.c',
|
||||||
|
install: true,
|
||||||
|
include_directories: includes,
|
||||||
|
link_with: [lib_libx52])
|
|
@ -0,0 +1,51 @@
|
||||||
|
libx52_files = files(
|
||||||
|
'x52_control.c',
|
||||||
|
'x52_core.c',
|
||||||
|
'x52_date_time.c',
|
||||||
|
'x52_mfd_led.c',
|
||||||
|
'x52_strerror.c',
|
||||||
|
'x52_stringify.c',
|
||||||
|
)
|
||||||
|
|
||||||
|
lib_libx52 = library('x52', libx52_files,
|
||||||
|
install: true,
|
||||||
|
version: '2.4.1',
|
||||||
|
dependencies: [dep_libusb],
|
||||||
|
include_directories: [includes])
|
||||||
|
|
||||||
|
install_headers('libx52.h', subdir: meson.project_name())
|
||||||
|
pkgconfig.generate(lib_libx52)
|
||||||
|
|
||||||
|
# Unit tests for libx52
|
||||||
|
libx52_string_test = executable('libx52-string-test',
|
||||||
|
'test_strings.c',
|
||||||
|
'x52_stringify.c',
|
||||||
|
'x52_strerror.c',
|
||||||
|
build_by_default: false,
|
||||||
|
dependencies: [dep_cmocka],
|
||||||
|
link_with: [lib_libx52],
|
||||||
|
include_directories: [includes, lib_libx52.private_dir_include()],
|
||||||
|
)
|
||||||
|
|
||||||
|
test('libx52-string-test', libx52_string_test, protocol: 'tap')
|
||||||
|
|
||||||
|
test_gen_script = files('x52_test_gen.py')[0]
|
||||||
|
|
||||||
|
libx52_test_file = custom_target('libx52-test',
|
||||||
|
build_by_default: false,
|
||||||
|
depend_files: ['x52_test_gen.py', 'x52_tests.json'],
|
||||||
|
command: [python, test_gen_script, '@INPUT@'],
|
||||||
|
capture: true,
|
||||||
|
input: 'x52_tests.json',
|
||||||
|
output: 'test_libx52.c'
|
||||||
|
)
|
||||||
|
|
||||||
|
libx52test = executable('libx52test', libx52_test_file, libx52_files,
|
||||||
|
c_args: ['-Dlibusb_control_transfer=__wrap_libusb_control_transfer'],
|
||||||
|
dependencies: [dep_cmocka, dep_libusb],
|
||||||
|
link_with: [lib_libx52],
|
||||||
|
build_by_default: false,
|
||||||
|
include_directories: [includes, lib_libx52.private_dir_include()],
|
||||||
|
)
|
||||||
|
|
||||||
|
test('libx52test', libx52test, protocol: 'tap')
|
|
@ -0,0 +1,32 @@
|
||||||
|
libx52io_files = files(
|
||||||
|
'io_core.c',
|
||||||
|
'io_axis.c',
|
||||||
|
'io_parser.c',
|
||||||
|
'io_strings.c',
|
||||||
|
'io_device.c',
|
||||||
|
)
|
||||||
|
|
||||||
|
lib_libx52io = library('x52io', libx52io_files,
|
||||||
|
install: true,
|
||||||
|
version: '1.0.0',
|
||||||
|
dependencies: [dep_hidapi],
|
||||||
|
include_directories: [includes])
|
||||||
|
|
||||||
|
install_headers('libx52io.h', subdir: meson.project_name())
|
||||||
|
pkgconfig.generate(lib_libx52io)
|
||||||
|
|
||||||
|
test_axis = executable('test-axis', 'test_axis.c', libx52io_files,
|
||||||
|
build_by_default: false,
|
||||||
|
dependencies: [dep_cmocka, dep_hidapi],
|
||||||
|
include_directories: [includes],
|
||||||
|
)
|
||||||
|
test('test-axis', test_axis, protocol: 'tap')
|
||||||
|
|
||||||
|
test_parser = executable('test-parser', 'test_parser.c', libx52io_files,
|
||||||
|
build_by_default: false,
|
||||||
|
dependencies: [dep_cmocka, dep_hidapi],
|
||||||
|
include_directories: [includes],
|
||||||
|
)
|
||||||
|
test('test-parser', test_parser, protocol: 'tap')
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,18 @@
|
||||||
|
# libx52util
|
||||||
|
gen_script = files('x52_char_map_gen.py')[0]
|
||||||
|
|
||||||
|
util_char_map = custom_target('util-char-map',
|
||||||
|
build_by_default: false,
|
||||||
|
depend_files: ['x52_char_map_gen.py', 'x52_char_map.cfg'],
|
||||||
|
command: [python, gen_script, '@INPUT@', '@OUTPUT@'],
|
||||||
|
input: 'x52_char_map.cfg',
|
||||||
|
output: 'util_char_map.c')
|
||||||
|
|
||||||
|
lib_libx52util = library('x52util', util_char_map, 'x52_char_map_lookup.c',
|
||||||
|
install: true,
|
||||||
|
version: '1.0.0',
|
||||||
|
include_directories: [includes],
|
||||||
|
)
|
||||||
|
|
||||||
|
install_headers('libx52util.h', subdir: meson.project_name())
|
||||||
|
pkgconfig.generate(lib_libx52util)
|
284
meson.build
284
meson.build
|
@ -40,57 +40,10 @@ python = pymod.find_installation('python3')
|
||||||
pyversion = python.language_version().split('.')
|
pyversion = python.language_version().split('.')
|
||||||
assert(pyversion[1].to_int() >= 5, 'Require Python >= 3.5')
|
assert(pyversion[1].to_int() >= 5, 'Require Python >= 3.5')
|
||||||
|
|
||||||
#######################################################################
|
|
||||||
# Version information
|
|
||||||
#######################################################################
|
|
||||||
compiler = meson.get_compiler('c')
|
|
||||||
compiler_version = run_command(compiler.cmd_array(), '--version',
|
|
||||||
capture: true,
|
|
||||||
check: true).stdout().split('\n')[0]
|
|
||||||
|
|
||||||
build_date = run_command('date', '+%Y-%m-%dT%H:%M:%S%z',
|
|
||||||
capture: true,
|
|
||||||
check: true).stdout().strip()
|
|
||||||
|
|
||||||
build_host = run_command('uname', '-a',
|
|
||||||
capture: true,
|
|
||||||
check: true).stdout().strip()
|
|
||||||
|
|
||||||
built_for = '@0@ @1@ @2@-endian'.format(
|
|
||||||
host_machine.system(),
|
|
||||||
host_machine.cpu(),
|
|
||||||
host_machine.endian(),
|
|
||||||
)
|
|
||||||
|
|
||||||
git = find_program('git', required: false)
|
|
||||||
if git.found()
|
|
||||||
vcs_describe = run_command(git, 'describe', '--dirty',
|
|
||||||
capture: true,
|
|
||||||
check: false).stdout().strip()
|
|
||||||
if vcs_describe == ''
|
|
||||||
vcs_describe = meson.project_version()
|
|
||||||
endif
|
|
||||||
else
|
|
||||||
vcs_describe = meson.project_version()
|
|
||||||
endif
|
|
||||||
|
|
||||||
version_data = configuration_data()
|
|
||||||
version_data.set_quoted('BUILD_VERSION', vcs_describe)
|
|
||||||
version_data.set_quoted('BUILD_DATE', build_date)
|
|
||||||
version_data.set_quoted('BUILD_HOST', build_host)
|
|
||||||
version_data.set_quoted('BUILD_COMPILER', compiler_version)
|
|
||||||
version_data.set_quoted('BUILD_TARGET', built_for)
|
|
||||||
version_data.set_quoted('BUILD_VERSION_INFO_IDENT', '$Id$')
|
|
||||||
|
|
||||||
version_info_h = configure_file(
|
|
||||||
input: 'version-info.h.meson',
|
|
||||||
output: 'version-info.h',
|
|
||||||
configuration: version_data
|
|
||||||
)
|
|
||||||
|
|
||||||
#######################################################################
|
#######################################################################
|
||||||
# config.h
|
# config.h
|
||||||
#######################################################################
|
#######################################################################
|
||||||
|
compiler = meson.get_compiler('c')
|
||||||
cdata = configuration_data()
|
cdata = configuration_data()
|
||||||
cdata.set_quoted('PACKAGE', meson.project_name())
|
cdata.set_quoted('PACKAGE', meson.project_name())
|
||||||
cdata.set_quoted('PACKAGE_BUGREPORT', 'https://github.com/nirenjan/libx52/issues')
|
cdata.set_quoted('PACKAGE_BUGREPORT', 'https://github.com/nirenjan/libx52/issues')
|
||||||
|
@ -105,13 +58,12 @@ cdata.set10('HAVE_FUNC_ATTRIBUTE_NORETURN', compiler.has_function_attribute('nor
|
||||||
cdata.set10('HAVE_STRUCT_TM_TM_GMTOFF',
|
cdata.set10('HAVE_STRUCT_TM_TM_GMTOFF',
|
||||||
compiler.has_member('struct tm', 'tm_gmtoff', prefix:'#include <time.h>'))
|
compiler.has_member('struct tm', 'tm_gmtoff', prefix:'#include <time.h>'))
|
||||||
|
|
||||||
|
|
||||||
config_h = configure_file(
|
config_h = configure_file(
|
||||||
input: 'config.h.meson',
|
input: 'config.h.meson',
|
||||||
output: 'config.h',
|
output: 'config.h',
|
||||||
configuration: cdata
|
configuration: cdata
|
||||||
)
|
)
|
||||||
#
|
|
||||||
#######################################################################
|
#######################################################################
|
||||||
# Internal dependencies
|
# Internal dependencies
|
||||||
#######################################################################
|
#######################################################################
|
||||||
|
@ -137,230 +89,20 @@ if not dep_inih.found()
|
||||||
endif
|
endif
|
||||||
|
|
||||||
#######################################################################
|
#######################################################################
|
||||||
# Shared libraries
|
# Shared libraries and programs
|
||||||
#######################################################################
|
#######################################################################
|
||||||
# Includes
|
# Includes
|
||||||
includes = include_directories('.', 'libx52')
|
includes = include_directories('.', 'libx52', 'libx52io', 'libx52util')
|
||||||
|
|
||||||
# libx52
|
subdir('libx52')
|
||||||
libx52_files = files(
|
subdir('libx52io')
|
||||||
'libx52/x52_control.c',
|
subdir('libx52util')
|
||||||
'libx52/x52_core.c',
|
subdir('bugreport')
|
||||||
'libx52/x52_date_time.c',
|
subdir('cli')
|
||||||
'libx52/x52_mfd_led.c',
|
subdir('joytest')
|
||||||
'libx52/x52_strerror.c',
|
subdir('evtest')
|
||||||
'libx52/x52_stringify.c',
|
subdir('daemon')
|
||||||
)
|
subdir('udev')
|
||||||
|
|
||||||
lib_libx52 = library('x52', libx52_files,
|
|
||||||
install: true,
|
|
||||||
version: '2.4.1',
|
|
||||||
dependencies: [dep_libusb])
|
|
||||||
|
|
||||||
install_headers('libx52/libx52.h', subdir: meson.project_name())
|
|
||||||
pkgconfig.generate(lib_libx52)
|
|
||||||
|
|
||||||
# Unit tests for libx52
|
|
||||||
libx52_string_test = executable('libx52-string-test',
|
|
||||||
'libx52/test_strings.c',
|
|
||||||
'libx52/x52_stringify.c',
|
|
||||||
'libx52/x52_strerror.c',
|
|
||||||
build_by_default: false,
|
|
||||||
dependencies: [dep_cmocka],
|
|
||||||
link_with: [lib_libx52],
|
|
||||||
include_directories: [includes, lib_libx52.private_dir_include()],
|
|
||||||
)
|
|
||||||
|
|
||||||
test('libx52-string-test', libx52_string_test, protocol: 'tap')
|
|
||||||
|
|
||||||
libx52_test_file = custom_target('libx52-test',
|
|
||||||
build_by_default: false,
|
|
||||||
depend_files: ['libx52/x52_test_gen.py', 'libx52/x52_tests.json'],
|
|
||||||
command: [python, '@SOURCE_ROOT@/libx52/x52_test_gen.py', '@INPUT@'],
|
|
||||||
capture: true,
|
|
||||||
input: 'libx52/x52_tests.json',
|
|
||||||
output: 'test_libx52.c'
|
|
||||||
)
|
|
||||||
|
|
||||||
libx52test = executable('libx52test', libx52_test_file, libx52_files,
|
|
||||||
c_args: ['-Dlibusb_control_transfer=__wrap_libusb_control_transfer'],
|
|
||||||
dependencies: [dep_cmocka, dep_libusb],
|
|
||||||
link_with: [lib_libx52],
|
|
||||||
build_by_default: false,
|
|
||||||
include_directories: [includes, lib_libx52.private_dir_include()],
|
|
||||||
)
|
|
||||||
|
|
||||||
test('libx52test', libx52test, protocol: 'tap')
|
|
||||||
|
|
||||||
# libx52io
|
|
||||||
libx52io_files = files(
|
|
||||||
'libx52io/io_core.c',
|
|
||||||
'libx52io/io_axis.c',
|
|
||||||
'libx52io/io_parser.c',
|
|
||||||
'libx52io/io_strings.c',
|
|
||||||
'libx52io/io_device.c',
|
|
||||||
)
|
|
||||||
|
|
||||||
lib_libx52io = library('x52io', libx52io_files,
|
|
||||||
install: true,
|
|
||||||
version: '1.0.0',
|
|
||||||
dependencies: [dep_hidapi])
|
|
||||||
|
|
||||||
install_headers('libx52io/libx52io.h', subdir: meson.project_name())
|
|
||||||
pkgconfig.generate(lib_libx52io)
|
|
||||||
|
|
||||||
test_axis = executable('test-axis', 'libx52io/test_axis.c', libx52io_files,
|
|
||||||
build_by_default: false,
|
|
||||||
dependencies: [dep_cmocka, dep_hidapi],
|
|
||||||
)
|
|
||||||
test('test-axis', test_axis, protocol: 'tap')
|
|
||||||
|
|
||||||
test_parser = executable('test-parser', 'libx52io/test_parser.c', libx52io_files,
|
|
||||||
build_by_default: false,
|
|
||||||
dependencies: [dep_cmocka, dep_hidapi],
|
|
||||||
)
|
|
||||||
test('test-parser', test_parser, protocol: 'tap')
|
|
||||||
|
|
||||||
# libx52util
|
|
||||||
util_char_map = custom_target('util-char-map',
|
|
||||||
build_by_default: false,
|
|
||||||
depend_files: ['libx52util/x52_char_map_gen.py', 'libx52util/x52_char_map.cfg'],
|
|
||||||
command: [python, '@SOURCE_ROOT@/libx52util/x52_char_map_gen.py', '@INPUT@', '@OUTPUT@'],
|
|
||||||
input: 'libx52util/x52_char_map.cfg',
|
|
||||||
output: 'util_char_map.c')
|
|
||||||
|
|
||||||
lib_libx52util = library('x52util', util_char_map, 'libx52util/x52_char_map_lookup.c',
|
|
||||||
include_directories: 'libx52util',
|
|
||||||
install: true,
|
|
||||||
version: '1.0.0',
|
|
||||||
)
|
|
||||||
|
|
||||||
install_headers('libx52util/libx52util.h', subdir: meson.project_name())
|
|
||||||
pkgconfig.generate(lib_libx52util)
|
|
||||||
|
|
||||||
#######################################################################
|
|
||||||
# Programs
|
|
||||||
#######################################################################
|
|
||||||
# x52bugreport
|
|
||||||
exe_bugreport = executable('x52bugreport', 'bugreport/bugreport.c',
|
|
||||||
install: true,
|
|
||||||
extra_files: ['bugreport/bugreport.dox'],
|
|
||||||
include_directories: 'libx52io',
|
|
||||||
dependencies: [dep_libusb, dep_hidapi],
|
|
||||||
link_with: [lib_libx52io])
|
|
||||||
|
|
||||||
# Test only to get code coverage
|
|
||||||
test('x52bugreport', exe_bugreport, protocol:'exitcode')
|
|
||||||
|
|
||||||
# x52cli
|
|
||||||
executable('x52cli', 'cli/x52_cli.c',
|
|
||||||
install: true,
|
|
||||||
include_directories: 'libx52',
|
|
||||||
link_with: lib_libx52)
|
|
||||||
|
|
||||||
test_cli = executable('test-cli', 'cli/x52_cli.c', 'cli/test_x52_cli.c',
|
|
||||||
build_by_default: false,
|
|
||||||
c_args: ['-DX52_CLI_TESTING'],
|
|
||||||
include_directories: 'libx52',
|
|
||||||
dependencies: [dep_cmocka],
|
|
||||||
)
|
|
||||||
|
|
||||||
test('test-cli', test_cli, protocol: 'tap')
|
|
||||||
|
|
||||||
# x52test
|
|
||||||
executable('x52test',
|
|
||||||
'joytest/x52_test.c',
|
|
||||||
'joytest/x52_test_mfd.c',
|
|
||||||
'joytest/x52_test_led.c',
|
|
||||||
'joytest/x52_test_clock.c',
|
|
||||||
install: true,
|
|
||||||
include_directories: includes,
|
|
||||||
link_with: [lib_libx52])
|
|
||||||
|
|
||||||
# x52evtest
|
|
||||||
executable('x52evtest', 'evtest/ev_test.c',
|
|
||||||
install: true,
|
|
||||||
include_directories: ['.', 'libx52io'],
|
|
||||||
link_with: [lib_libx52io])
|
|
||||||
|
|
||||||
# x52d
|
|
||||||
libx52dcomm_sources = [
|
|
||||||
'daemon/x52d_comm_client.c',
|
|
||||||
'daemon/x52d_comm_internal.c'
|
|
||||||
]
|
|
||||||
|
|
||||||
install_headers('daemon/x52dcomm.h', subdir: meson.project_name())
|
|
||||||
|
|
||||||
lib_libx52dcomm = library('x52dcomm', libx52dcomm_sources)
|
|
||||||
|
|
||||||
x52d_sources = [
|
|
||||||
'daemon/x52d_main.c',
|
|
||||||
'daemon/x52d_config_parser.c',
|
|
||||||
'daemon/x52d_config_dump.c',
|
|
||||||
'daemon/x52d_config.c',
|
|
||||||
'daemon/x52d_device.c',
|
|
||||||
'daemon/x52d_client.c',
|
|
||||||
'daemon/x52d_clock.c',
|
|
||||||
'daemon/x52d_mouse.c',
|
|
||||||
'daemon/x52d_notify.c',
|
|
||||||
'daemon/x52d_led.c',
|
|
||||||
'daemon/x52d_command.c',
|
|
||||||
]
|
|
||||||
|
|
||||||
dep_threads = dependency('threads')
|
|
||||||
x52d_linkwith = [lib_libx52, lib_libx52dcomm]
|
|
||||||
x52d_deps = [dep_pinelog, dep_inih, dep_threads]
|
|
||||||
x52d_cflags = []
|
|
||||||
if dep_evdev.found()
|
|
||||||
x52d_sources += 'daemon/x52d_io.c'
|
|
||||||
x52d_sources += 'daemon/x52d_mouse_evdev.c'
|
|
||||||
x52d_cflags += '-DHAVE_EVDEV'
|
|
||||||
x52d_linkwith += lib_libx52io
|
|
||||||
x52d_deps += dep_evdev
|
|
||||||
endif
|
|
||||||
|
|
||||||
|
|
||||||
exe_x52d = executable('x52d', x52d_sources,
|
|
||||||
install: true,
|
|
||||||
include_directories: ['.', 'libx52', 'libx52io', 'libx52util'],
|
|
||||||
c_args: x52d_cflags,
|
|
||||||
dependencies: x52d_deps,
|
|
||||||
link_with: x52d_linkwith)
|
|
||||||
|
|
||||||
executable('x52ctl', 'daemon/x52ctl.c',
|
|
||||||
install: true,
|
|
||||||
include_directories: ['.'],
|
|
||||||
link_with: lib_libx52dcomm)
|
|
||||||
|
|
||||||
install_data('daemon/x52d.conf',
|
|
||||||
install_dir: join_paths(get_option('sysconfdir'), 'x52d'))
|
|
||||||
|
|
||||||
test('daemon-communication', files('daemon/test_daemon_comm.py')[0],
|
|
||||||
depends: exe_x52d, protocol: 'tap')
|
|
||||||
|
|
||||||
x52d_mouse_test_sources = ['daemon/x52d_mouse_test.c', 'daemon/x52d_mouse.c']
|
|
||||||
x52d_mouse_test = executable('x52d-mouse-test', x52d_mouse_test_sources,
|
|
||||||
include_directories: ['.', 'libx52', 'libx52io'],
|
|
||||||
dependencies: [dep_pinelog, dep_cmocka])
|
|
||||||
|
|
||||||
test('x52d-mouse-test', x52d_mouse_test, protocol: 'tap')
|
|
||||||
|
|
||||||
# udev rules
|
|
||||||
if dep_udev.found()
|
|
||||||
if meson.version().version_compare('>= 0.58.0')
|
|
||||||
udev_dir = dep_udev.get_variable('udevdir', default_value:'/lib/udev')
|
|
||||||
else
|
|
||||||
udev_dir = dep_udev.get_pkgconfig_variable('udevdir', default:'/lib/udev')
|
|
||||||
endif
|
|
||||||
udev_rules_dir = join_paths(udev_dir, 'rules.d')
|
|
||||||
udev_file = configure_file(
|
|
||||||
input: 'udev/60-saitek-x52-x52pro.rules.in',
|
|
||||||
output: '60-saitek-x52-x52pro.rules',
|
|
||||||
configuration: {'input_group': get_option('input-group')}
|
|
||||||
)
|
|
||||||
install_data(udev_file, install_dir: udev_rules_dir)
|
|
||||||
meson.add_install_script('udev/install-hook.sh')
|
|
||||||
endif
|
|
||||||
|
|
||||||
#######################################################################
|
#######################################################################
|
||||||
# Documentation - doxygen
|
# Documentation - doxygen
|
||||||
|
|
|
@ -0,0 +1,16 @@
|
||||||
|
# udev rules
|
||||||
|
if dep_udev.found()
|
||||||
|
if meson.version().version_compare('>= 0.58.0')
|
||||||
|
udev_dir = dep_udev.get_variable('udevdir', default_value:'/lib/udev')
|
||||||
|
else
|
||||||
|
udev_dir = dep_udev.get_pkgconfig_variable('udevdir', default:'/lib/udev')
|
||||||
|
endif
|
||||||
|
udev_rules_dir = join_paths(udev_dir, 'rules.d')
|
||||||
|
udev_file = configure_file(
|
||||||
|
input: '60-saitek-x52-x52pro.rules.in',
|
||||||
|
output: '60-saitek-x52-x52pro.rules',
|
||||||
|
configuration: {'input_group': get_option('input-group')}
|
||||||
|
)
|
||||||
|
install_data(udev_file, install_dir: udev_rules_dir)
|
||||||
|
meson.add_install_script('install-hook.sh')
|
||||||
|
endif
|
Loading…
Reference in New Issue