aboutsummaryrefslogtreecommitdiff
path: root/meson.build
blob: 5c826a78448a0d637d881cdb4e67cf2512a8779e (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
45
46
47
48
49
50
51
52
53
54
55
56
57
project('sok', 'c', default_options: ['c_std=c11'])

# find libm (used for SDL version)
cc = meson.get_compiler('c')
libm = cc.find_library('m', required: true)

sources = [
  'src/libsok/sok-level-parser.c',
  'src/libsok/sok-ctx.c',
  'src/libsok/sok-ctx-hash.c',
  'src/libsok/sok-cache.c',
  'src/libsok/sok-solve.c',
]

# text exe
executable('sok-text', sources + [
  'src/text/main.c',
  'src/text/levels.c',
  'src/text/action.c',
  'src/text/draw.c',
], dependencies: [])

# sdl exe
executable('sok-sdl', sources + [
  'src/text/levels.c',
  'src/sdl/warp-buf.c',
  'src/sdl/color.c',
  'src/sdl/action.c',
  'src/sdl/sprites.c',
  'src/sdl/draw.c',
  'src/sdl/main.c',
], dependencies: [
  dependency('SDL2'),
  dependency('SDL2_ttf'),
  libm,
])

# sprite-packer exe
executable('sprite-packer', sources + [
  'src/sprite-packer/main.c',
], dependencies: [
  dependency('SDL2'),
  libm,
])

# test executable
test_solve = executable('test-solve', sources + [
  'src/text/levels.c',
  'src/test-solve/main.c',
], dependencies: [])

# generate solve tests
foreach i: [0, 3, 4, 11, 18, 23] # long tests: 14, 17, 22, 26
  test('level @0@'.format(i), test_solve, args: [
    '@0@'.format(i),
  ])
endforeach