meson: add test-libudev-sym
This is slightly complicated by the fact that files('libudev.h') cannot be used as an argument in custom_target command (string is required). This restriction should be lifted in future versions of mesons, so this could be simplified.
This commit is contained in:
parent
37ab1a25ec
commit
e0bec52f27
11
meson.build
11
meson.build
|
@ -1948,6 +1948,17 @@ test_libsystemd_sym = executable(
|
||||||
test('test-libsystemd-sym',
|
test('test-libsystemd-sym',
|
||||||
test_libsystemd_sym)
|
test_libsystemd_sym)
|
||||||
|
|
||||||
|
test_libudev_sym = executable(
|
||||||
|
'test-libudev-sym',
|
||||||
|
test_libudev_sym_c,
|
||||||
|
include_directories : includes,
|
||||||
|
c_args : ['-Wno-deprecated-declarations'],
|
||||||
|
link_args : ['src/libudev/libudev.so.1.6.6'],
|
||||||
|
install : install_tests,
|
||||||
|
install_dir : testsdir)
|
||||||
|
test('test-libudev-sym',
|
||||||
|
test_libudev_sym)
|
||||||
|
|
||||||
############################################################
|
############################################################
|
||||||
|
|
||||||
make_directive_index_py = find_program('tools/make-directive-index.py')
|
make_directive_index_py = find_program('tools/make-directive-index.py')
|
||||||
|
|
|
@ -17,15 +17,14 @@ libudev_sources = '''
|
||||||
############################################################
|
############################################################
|
||||||
|
|
||||||
libudev_sym = 'libudev.sym'
|
libudev_sym = 'libudev.sym'
|
||||||
|
libudev_sym_path = '@0@/@1@'.format(meson.current_source_dir(), libudev_sym)
|
||||||
version_script_arg = '@0@/@1@'.format(meson.current_source_dir(), libudev_sym)
|
|
||||||
libudev = shared_library(
|
libudev = shared_library(
|
||||||
'udev',
|
'udev',
|
||||||
libudev_sources,
|
libudev_sources,
|
||||||
version : '1.6.6',
|
version : '1.6.6',
|
||||||
include_directories : includes,
|
include_directories : includes,
|
||||||
link_args : ['-shared',
|
link_args : ['-shared',
|
||||||
'-Wl,--version-script=' + version_script_arg],
|
'-Wl,--version-script=' + libudev_sym_path],
|
||||||
link_with : [libbasic,
|
link_with : [libbasic,
|
||||||
libsystemd],
|
libsystemd],
|
||||||
link_depends : libudev_sym,
|
link_depends : libudev_sym,
|
||||||
|
@ -40,6 +39,7 @@ libudev_internal = static_library(
|
||||||
libsystemd])
|
libsystemd])
|
||||||
|
|
||||||
install_headers('libudev.h')
|
install_headers('libudev.h')
|
||||||
|
libudev_h_path = '@0@/libudev.h'.format(meson.current_source_dir())
|
||||||
|
|
||||||
libudev_pc = configure_file(
|
libudev_pc = configure_file(
|
||||||
input : 'libudev.pc.in',
|
input : 'libudev.pc.in',
|
||||||
|
|
|
@ -28,6 +28,13 @@ test_libsystemd_sym_c = custom_target(
|
||||||
command : [generate_sym_test_py, libsystemd_sym_path] + systemd_headers,
|
command : [generate_sym_test_py, libsystemd_sym_path] + systemd_headers,
|
||||||
capture : true)
|
capture : true)
|
||||||
|
|
||||||
|
test_libudev_sym_c = custom_target(
|
||||||
|
'test-libudev-sym.c',
|
||||||
|
input : [libudev_sym_path, libudev_h_path],
|
||||||
|
output : 'test-libudev-sym.c',
|
||||||
|
command : [generate_sym_test_py, '@INPUT0@', '@INPUT1@'],
|
||||||
|
capture : true)
|
||||||
|
|
||||||
############################################################
|
############################################################
|
||||||
|
|
||||||
tests += [
|
tests += [
|
||||||
|
|
Loading…
Reference in New Issue