summaryrefslogtreecommitdiffstats
path: root/test cases/vala/8 generated sources/dependency-generated/meson.build
blob: a1895b4f7b881cf86f5cbb6cf0e8530cd24cb5ad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# Test that dependencies with their own generated sources don't
# confuse the Vala build instruction generator.

# Test case for https://github.com/mesonbuild/meson/issues/1084

gnome = import('gnome')

gobject = dependency('gobject-2.0')

enums = gnome.mkenums('enum-types',
    sources: 'enums.h',
    c_template: 'enum-types.c.template',
    h_template: 'enum-types.h.template',
)

libcommon = library('common',
    enums[0], enums[1],
    dependencies: gobject)

common_dep = declare_dependency(
    # This is required so that whoever depends on this also depends
    # on the generated header; that won't happen implicitly.
    # See: https://github.com/mesonbuild/meson/issues/1084
    sources: enums[1],
    link_with: libcommon,
)

libplover_vala = library('plover',
    'lib.vala',
    dependencies: [common_dep, gobject]
)

plover_dep = declare_dependency(
    link_with: libplover_vala,
    dependencies: common_dep
)

vala_prog = executable('hello',
    'main.vala',
    link_with: libplover_vala,
    # There's no need to specify common_dep here since plover_dep pulls it
    # in, but it should be harmless to do so.
    dependencies: [common_dep, plover_dep, gobject]
)