~nloomans/ft_select

ref: 2e75cb9f27ad9eb723b601f132a4e1449d02a31f ft_select/meson.build -rw-r--r-- 1.5 KiB
2e75cb9fNoah Loomans fix event norm 1 year, 10 months ago
                                                                                
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
project(
  'ft_select',
  'c',
  default_options: [
    'c_std=c99',
    'warning_level=3',
    'werror=true',
  ]
)

cc = meson.get_compiler('c')

libft_proj = subproject('libft')
libft_deb = libft_proj.get_variable('libft_deb')

libftprintf_proj = subproject('libftprintf')
libftprintf_deb = libftprintf_proj.get_variable('libftprintf_deb')

libcurses_deb = cc.find_library('curses', required: false)
if not libcurses_deb.found()
	libcurses_deb = dependency('ncurses')
endif

inc_dir = include_directories('inc')
src_files = files([
  'src/main.c',
  'src/action/confirm.c',
  'src/action/delete.c',
  'src/action/move.c',
  'src/action/noop.c',
  'src/action/quit.c',
  'src/action/select.c',
  'src/action/update_size.c',
  'src/derive.c',
  'src/derive_rows.c',
  'src/error.c',
  'src/event.c',
  'src/handle.c',
  'src/list2.c',
  'src/read.c',
  'src/state.c',
  'src/terminal.c',
])

if get_option('render') == 'debug'
  src_files += 'src/render.debug.c'
else
  src_files += 'src/render.c'
endif

executable(
  'ft_select',
  sources: src_files,
  include_directories: inc_dir,
  dependencies: [libft_deb, libftprintf_deb, libcurses_deb],
)

libcriterion_deb = dependency('criterion', required: false)

if libcriterion_deb.found()
  test_files = files([
    'src/list2.c',
    'src/list2_test.c',
  ])

  tester = executable('test-ft_select',
    sources: test_files,
    include_directories: inc_dir,
    dependencies: [libft_deb, libftprintf_deb, libcurses_deb, libcriterion_deb])

  test('ft_select', tester)
endif