summaryrefslogtreecommitdiff
path: root/libgweather/tools/meson.build
blob: c1f63c689d3b4d75a6ad094528c838917a288821 (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
tools = [
  {
    'name': 'locations',
  },
  {
    'name': 'locations_utc',
  },
  {
    'name': 'metar',
  },
  {
    'name': 'sun_moon',
    'sources': [
      'test_sun_moon.c',
      '../weather-sun.c',
      '../weather-moon.c',
    ],
  },
  {
    'name': 'weather',
  }
]

tools_cargs = [
  '-DTEST_LOCATIONS="@0@"'.format(locations_bin.full_path()),
  '-DSCHEMASDIR="@0@/schemas"'.format(meson.source_root()),
  '-DSCHEMAS_BUILDDIR="@0@/schemas"'.format(meson.build_root()),
]

foreach tool: tools
  tool_name = tool.get('name')
  tool_sources = tool.get('sources', ['test_' + tool_name + '.c'])

  executable('test_' + tool_name,
    sources: tool_sources,
    c_args: tools_cargs,
    dependencies: libgweather_static_dep,
    install: false,
  )
endforeach