| 1 |
# Test that dependencies with their own generated sources don't |
| 2 |
# confuse the Vala build instruction generator. |
| 3 |
|
| 4 |
# Test case for https://github.com/mesonbuild/meson/issues/1084 |
| 5 |
|
| 6 |
gnome = import('gnome') |
| 7 |
|
| 8 |
gobject = dependency('gobject-2.0') |
| 9 |
|
| 10 |
enums = gnome.mkenums('enum-types', |
| 11 |
sources: 'enums.h', |
| 12 |
c_template: 'enum-types.c.template', |
| 13 |
h_template: 'enum-types.h.template', |
| 14 |
) |
| 15 |
|
| 16 |
libcommon = library('common', |
| 17 |
enums[0], enums[1], |
| 18 |
dependencies: gobject) |
| 19 |
|
| 20 |
common_dep = declare_dependency( |
| 21 |
# This is required so that whoever depends on this also depends |
| 22 |
# on the generated header; that won't happen implicitly. |
| 23 |
# See: https://github.com/mesonbuild/meson/issues/1084 |
| 24 |
sources: enums[1], |
| 25 |
link_with: libcommon, |
| 26 |
) |
| 27 |
|
| 28 |
libplover_vala = library('plover', |
| 29 |
'lib.vala', |
| 30 |
dependencies: [common_dep, gobject] |
| 31 |
) |
| 32 |
|
| 33 |
plover_dep = declare_dependency( |
| 34 |
link_with: libplover_vala, |
| 35 |
dependencies: common_dep |
| 36 |
) |
| 37 |
|
| 38 |
vala_prog = executable('hello', |
| 39 |
'main.vala', |
| 40 |
link_with: libplover_vala, |
| 41 |
# There's no need to specify common_dep here since plover_dep pulls it |
| 42 |
# in, but it should be harmless to do so. |
| 43 |
dependencies: [common_dep, plover_dep, gobject] |
| 44 |
) |