| 1 |
subdir('lib1') |
| 2 |
subdir('lib2') |
| 3 |
subdir('lib3') |
| 4 |
|
| 5 |
main = executable('say', 'main.c', link_with: [lib2], include_directories: lib2_includes) |
| 6 |
|
| 7 |
main_pot = i18n.xgettext('main', main, args: xgettext_args, install: true, install_dir: 'intl', install_tag: 'intl', recursive: true) |
| 8 |
|
| 9 |
shmain = executable('shsay', 'main.c', link_with: [shlib2], include_directories: lib2_includes) |
| 10 |
shmain_pot = i18n.xgettext('shmain', shmain, args: xgettext_args, recursive: true) |
| 11 |
|
| 12 |
verify = find_program('verify.py') |
| 13 |
|
| 14 |
# main links lib2 and lib2 links lib1, but main does not link lib1 directly. |
| 15 |
# With recursive: true, the .pot must pick up lib1's "Something!" transitively |
| 16 |
# through lib2, not just lib2's own "Something else!". |
| 17 |
test( |
| 18 |
'recursive xgettext through static libraries', |
| 19 |
verify, |
| 20 |
args: [main_pot, 'Something else!', 'Something!'], |
| 21 |
) |
| 22 |
|
| 23 |
# Same chain, but with shared libraries. Unlike static libraries, shared |
| 24 |
# libraries do not pull in their dependencies' objects, so shlib1 is not part |
| 25 |
# of shmain.get_dependencies(). Recursive xgettext must still descend through |
| 26 |
# shlib2 to reach shlib1's strings. |
| 27 |
test( |
| 28 |
'recursive xgettext through shared libraries', |
| 29 |
verify, |
| 30 |
args: [shmain_pot, 'Something else!', 'Something!'], |
| 31 |
) |