-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmeson.build
101 lines (85 loc) · 1.57 KB
/
meson.build
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
project(
'candor',
'c',
default_options: [
'c_std=c99',
'warning_level=2',
],
)
add_project_arguments(
[
'-DWLR_USE_UNSTABLE',
'-D_POSIX_C_SOURCE=200809L',
],
language: 'c',
)
stdlib = get_option('stdlib')
if stdlib == ''
stdlib = join_paths(
get_option('prefix'),
get_option('datadir'),
'candor', 'stdlib'
)
endif
config = configuration_data()
config.set('version', '0.1.1')
config.set('stdlib', stdlib)
configure_file(
input: 'config.h.in',
output: 'config.h',
configuration: config
)
##################
# candor lib #
##################
candor_sources = [
'candor/candor.c',
'candor/cval.c',
'candor/cenv.c',
'candor/parser.c',
'candor/builtins.c',
'candor/builtins/conditional.c',
'candor/builtins/list.c',
'candor/builtins/math.c',
'candor/builtins/string.c',
'candor/builtins/stdlib/proc.c',
]
mpc = dependency('mpc')
libedit = dependency('libeditline')
incdirs = include_directories([
'subprojects',
'.'
])
install_headers('candor.h')
install_subdir('stdlib', install_dir: stdlib, strip_directory: true)
candor_lib = library(
'candor',
candor_sources,
include_directories: incdirs,
dependencies: [
mpc,
],
install: true,
)
pkg = import('pkgconfig')
pkg.generate(candor_lib)
candor_dep = declare_dependency(
include_directories: incdirs,
link_with: candor_lib,
)
##################
# candor #
##################
executable(
'candor',
[
'src/main.c',
'src/repl.c',
],
include_directories: incdirs,
dependencies: [
candor_dep,
libedit,
mpc,
],
)