| 1 |
# |
| 2 |
# target: libcdvar.so |
| 3 |
# |
| 4 |
|
| 5 |
libcdvar_symfile = join_paths(meson.current_source_dir(), 'libcdvar.sym') |
| 6 |
|
| 7 |
libcdvar_deps = [ |
| 8 |
dep_cstdaux, |
| 9 |
dep_cutf8, |
| 10 |
] |
| 11 |
|
| 12 |
libcdvar_both = both_libraries( |
| 13 |
'cdvar-'+major, |
| 14 |
[ |
| 15 |
'c-dvar.c', |
| 16 |
'c-dvar-common.c', |
| 17 |
'c-dvar-reader.c', |
| 18 |
'c-dvar-type.c', |
| 19 |
'c-dvar-writer.c', |
| 20 |
], |
| 21 |
c_args: [ |
| 22 |
'-fvisibility=hidden', |
| 23 |
'-fno-common', |
| 24 |
], |
| 25 |
dependencies: libcdvar_deps, |
| 26 |
install: not meson.is_subproject(), |
| 27 |
link_args: dep_cstdaux.get_variable('version_scripts') == 'yes' ? [ |
| 28 |
'-Wl,--version-script=@0@'.format(libcdvar_symfile), |
| 29 |
] : [], |
| 30 |
link_depends: libcdvar_symfile, |
| 31 |
soversion: 0, |
| 32 |
) |
| 33 |
|
| 34 |
libcdvar_dep = declare_dependency( |
| 35 |
dependencies: libcdvar_deps, |
| 36 |
include_directories: include_directories('.'), |
| 37 |
link_with: libcdvar_both.get_static_lib(), |
| 38 |
version: meson.project_version(), |
| 39 |
) |
| 40 |
|
| 41 |
if not meson.is_subproject() |
| 42 |
install_headers( |
| 43 |
'c-dvar.h', |
| 44 |
'c-dvar-type.h', |
| 45 |
) |
| 46 |
|
| 47 |
mod_pkgconfig.generate( |
| 48 |
description: project_description, |
| 49 |
filebase: 'libcdvar-'+major, |
| 50 |
libraries: libcdvar_both.get_shared_lib(), |
| 51 |
name: 'libcdvar', |
| 52 |
version: meson.project_version(), |
| 53 |
) |
| 54 |
endif |
| 55 |
|
| 56 |
# |
| 57 |
# target: test-* |
| 58 |
# |
| 59 |
|
| 60 |
test_api = executable('test-api', ['test-api.c'], link_with: libcdvar_both.get_shared_lib()) |
| 61 |
test('API Symbol Visibility', test_api) |
| 62 |
|
| 63 |
test_basic = executable('test-basic', ['test-basic.c'], dependencies: libcdvar_dep) |
| 64 |
test('Basic API Behavior', test_basic) |
| 65 |
|
| 66 |
if dep_typenum.found() |
| 67 |
test_enumerated = executable('test-enumerated', ['test-enumerated.c'], dependencies: [ libcdvar_dep, dep_typenum ]) |
| 68 |
test('Type and Data Verification with Enumerated Types', test_enumerated) |
| 69 |
endif |
| 70 |
|
| 71 |
test_string = executable('test-string', ['test-string.c'], dependencies: libcdvar_dep) |
| 72 |
test('D-Bus String Restrictions', test_string) |
| 73 |
|
| 74 |
test_type = executable('test-type', ['test-type.c'], dependencies: libcdvar_dep) |
| 75 |
test('Type and Signature Parser', test_type) |