2020-07-14 14:41:32 +10:00
|
|
|
project('libei', 'c',
|
|
|
|
|
version: '0.1',
|
|
|
|
|
license: 'MIT/Expat',
|
|
|
|
|
default_options: [ 'c_std=gnu99', 'warning_level=2' ],
|
|
|
|
|
meson_version: '>= 0.50.0')
|
|
|
|
|
|
|
|
|
|
pkgconfig = import('pkgconfig')
|
|
|
|
|
|
|
|
|
|
cc = meson.get_compiler('c')
|
|
|
|
|
cppflags = ['-Wno-unused-parameter', '-fvisibility=hidden']
|
|
|
|
|
cflags = cppflags + ['-Wmissing-prototypes', '-Wstrict-prototypes']
|
2020-07-31 09:41:29 +10:00
|
|
|
add_project_arguments(cflags, language: 'c')
|
|
|
|
|
add_project_arguments(cppflags, language: 'cpp')
|
2020-07-14 14:41:32 +10:00
|
|
|
|
2020-07-28 14:19:28 +10:00
|
|
|
config_h = configuration_data()
|
|
|
|
|
config_h.set('_GNU_SOURCE', '1')
|
|
|
|
|
|
|
|
|
|
lib_util = static_library('util',
|
|
|
|
|
'src/util-io.h',
|
|
|
|
|
'src/util-list.h',
|
|
|
|
|
'src/util-list.c',
|
|
|
|
|
'src/util-logger.h',
|
|
|
|
|
'src/util-logger.c',
|
|
|
|
|
'src/util-macros.h',
|
|
|
|
|
'src/util-object.h',
|
|
|
|
|
'src/util-sources.h',
|
|
|
|
|
'src/util-sources.c',
|
|
|
|
|
'src/util-strings.c',
|
|
|
|
|
'src/util-strings.h',
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
dep_libutil = declare_dependency(link_with: lib_util)
|
|
|
|
|
|
|
|
|
|
|
2020-07-14 14:41:32 +10:00
|
|
|
lib_libei = shared_library('ei',
|
|
|
|
|
'src/libei.h',
|
|
|
|
|
'src/libei.c',
|
2020-07-29 11:53:03 +10:00
|
|
|
'src/libei-device.c',
|
|
|
|
|
'src/libei-socket.c',
|
2020-07-28 14:19:28 +10:00
|
|
|
dependencies: [dep_libutil],
|
2020-07-14 14:41:32 +10:00
|
|
|
install: true
|
|
|
|
|
)
|
2020-07-29 14:08:59 +10:00
|
|
|
install_headers('src/libei.h')
|
2020-07-14 14:41:32 +10:00
|
|
|
|
2020-07-29 11:53:03 +10:00
|
|
|
dep_libei = declare_dependency(link_with: lib_libei,
|
|
|
|
|
include_directories: 'src')
|
|
|
|
|
|
2020-07-14 14:41:32 +10:00
|
|
|
pkgconfig.generate(lib_libei,
|
|
|
|
|
filebase: 'libei',
|
2020-07-31 09:41:29 +10:00
|
|
|
name: 'libEI',
|
|
|
|
|
description: 'Emulated Input client library',
|
|
|
|
|
version: meson.project_version(),
|
|
|
|
|
libraries: lib_libei,
|
2020-07-14 14:41:32 +10:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
lib_libeis = shared_library('eis',
|
|
|
|
|
'src/libeis.h',
|
|
|
|
|
'src/libeis.c',
|
2020-07-28 14:19:28 +10:00
|
|
|
'src/libeis-client.c',
|
|
|
|
|
'src/libeis-device.c',
|
|
|
|
|
'src/libeis-socket.c',
|
|
|
|
|
dependencies: [dep_libutil],
|
2020-07-14 14:41:32 +10:00
|
|
|
install: true
|
|
|
|
|
)
|
2020-07-29 14:08:59 +10:00
|
|
|
install_headers('src/libeis.h')
|
2020-07-28 14:19:28 +10:00
|
|
|
|
|
|
|
|
dep_libeis = declare_dependency(link_with: lib_libeis,
|
|
|
|
|
include_directories: 'src')
|
|
|
|
|
|
2020-07-14 14:41:32 +10:00
|
|
|
pkgconfig.generate(lib_libeis,
|
|
|
|
|
filebase: 'libeis',
|
2020-07-31 09:41:29 +10:00
|
|
|
name: 'libEIS',
|
|
|
|
|
description: 'Emulated Input server library',
|
|
|
|
|
version: meson.project_version(),
|
|
|
|
|
libraries: lib_libeis,
|
2020-07-14 14:41:32 +10:00
|
|
|
)
|
2020-07-28 14:19:28 +10:00
|
|
|
|
|
|
|
|
|
|
|
|
|
executable('eis-socket-server',
|
|
|
|
|
'tools/eis-socket-server.c',
|
|
|
|
|
dependencies: [dep_libeis])
|
|
|
|
|
|
2020-07-29 11:53:03 +10:00
|
|
|
executable('ei-socket-client',
|
|
|
|
|
'tools/ei-socket-client.c',
|
|
|
|
|
dependencies: [dep_libei])
|
2020-07-28 14:19:28 +10:00
|
|
|
|
2020-07-31 09:56:07 +10:00
|
|
|
# tests
|
|
|
|
|
subproject('munit')
|
|
|
|
|
|
|
|
|
|
munit = dependency('munit', fallback: ['munit', 'munit_dep'])
|
|
|
|
|
|
|
|
|
|
test('iotest',
|
|
|
|
|
executable('iotest',
|
|
|
|
|
'test/iotest.c',
|
|
|
|
|
include_directories: 'src',
|
|
|
|
|
dependencies: munit))
|
|
|
|
|
|
|
|
|
|
valgrind = find_program('valgrind', required : false)
|
|
|
|
|
if valgrind.found()
|
|
|
|
|
add_test_setup('valgrind',
|
|
|
|
|
exe_wrapper : [ valgrind,
|
|
|
|
|
'--leak-check=full',
|
|
|
|
|
'--gen-suppressions=all',
|
|
|
|
|
'--error-exitcode=3' ],
|
|
|
|
|
timeout_multiplier : 100)
|
|
|
|
|
else
|
|
|
|
|
message('valgrind not found, disabling valgrind test suite')
|
|
|
|
|
endif
|
|
|
|
|
|
2020-07-31 09:41:29 +10:00
|
|
|
configure_file(output: 'config.h', configuration: config_h)
|