master meson.build
 1project(
 2  'cterm',
 3  'c',
 4  meson_version: '>=1.1.0',
 5  default_options: [
 6    'c_std=c99',
 7    'warning_level=2',
 8    'optimization=2',
 9  ],
10)
11
12cc = meson.get_compiler('c')
13fs = import('fs')
14
15backend = get_option('window_backend')
16
17maus_project = subproject(
18  'libmaus',
19  default_options: ['window_backend=' + backend],
20)
21maus_dep = maus_project.get_variable('maus_dep')
22
23if not fs.exists('config.h')
24  configure_file(input: 'config.def.h', output: 'config.h', copy: true,)
25endif
26
27inc = include_directories('.', 'include')
28
29deps = [maus_dep]
30c_args = []
31
32if host_machine.system() == 'linux'
33  c_args += ['-D_XOPEN_SOURCE=700']
34elif host_machine.system() == 'freebsd' or host_machine.system() == 'openbsd'
35  deps += cc.find_library('util')
36endif
37
38sources = [
39  'source/cterm.c',
40  'source/draw.c',
41  'source/font.c',
42  'source/term.c',
43  'source/utils.c',
44]
45
46executable(
47  'cterm',
48  sources,
49  include_directories: inc,
50  dependencies: deps,
51  c_args: c_args,
52  install: true,
53)
54