-
Notifications
You must be signed in to change notification settings - Fork 1
/
meson.build
137 lines (127 loc) · 3.07 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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
project('dragonblocks', 'c', default_options: ['warning_level=2'])
add_project_arguments([
'-Wno-address-of-packed-member',
'-DGLEW_NO_GLU',
'-DUSE_DRAGONNET',
'-D_GNU_SOURCE', # TODO: remove once posix 2024 is in glibc
'-DASSET_PATH="' + get_option('asset_path') + '"',
], language: 'c')
cc = meson.get_compiler('c')
include = 'src/'
deps = [
cc.find_library('m', required: false),
dependency('threads'),
dependency('protogen'),
dependency('linmath'),
dependency('perlin'),
dependency('dragonnet'),
dependency('dragonstd'),
dependency('zlib'),
]
if not cc.check_header('endian.h')
deps += dependency('endian')
endif
if not cc.has_function('getline')
deps += dependency('getline')
endif
common_lib = static_library('dragonblocks',
sources: [
vcs_tag(
command: [find_program('git'), 'describe', '--tags'],
input: 'src/version.h.in',
output: 'version.h',
replace_string: '@GIT_VERSION@',
),
custom_target('protogen_types',
output: ['types.c', 'types.h'],
input: 'src/types.def',
command: [find_program('protogen'), '@INPUT@', '@OUTPUT@'],
),
'src/common/color.c',
'src/common/config.c',
'src/common/day.c',
'src/common/environment.c',
'src/common/facedir.c',
'src/common/fs.c',
'src/common/init.c',
'src/common/interrupt.c',
'src/common/item.c',
'src/common/node.c',
'src/common/perlin.c',
'src/common/physics.c',
'src/common/terrain.c',
],
dependencies: deps,
include_directories: include,
)
common = declare_dependency(
link_with: common_lib,
dependencies: deps,
include_directories: include,
)
executable('dragonblocks-client',
sources: [
'src/client/action.c',
'src/client/camera.c',
'src/client/client.c',
'src/client/client_auth.c',
'src/client/client_config.c',
'src/client/client_entity.c',
'src/client/client_inventory.c',
'src/client/client_item.c',
'src/client/client_node.c',
'src/client/client_player.c',
'src/client/client_terrain.c',
'src/client/cube.c',
'src/client/debug_menu.c',
'src/client/facecache.c',
'src/client/font.c',
'src/client/frustum.c',
'src/client/game.c',
'src/client/gui.c',
'src/client/input.c',
'src/client/interact.c',
'src/client/light.c',
'src/client/mesh.c',
'src/client/model.c',
'src/client/opengl.c',
'src/client/raycast.c',
'src/client/screenshot.c',
'src/client/shader.c',
'src/client/sky.c',
'src/client/terrain_gfx.c',
'src/client/texture.c',
'src/client/window.c',
],
dependencies: [
common,
dependency('stb'),
dependency('glew'),
dependency('gl'),
dependency('glfw3'),
],
install: true,
)
executable('dragonblocks-server',
sources: [
'src/server/biomes.c',
'src/server/database.c',
'src/server/schematic.c',
'src/server/server.c',
'src/server/server_config.c',
'src/server/server_item.c',
'src/server/server_node.c',
'src/server/server_player.c',
'src/server/server_terrain.c',
'src/server/terrain_gen.c',
'src/server/tree.c',
'src/server/tree_physics.c',
'src/server/voxel_depth_search.c',
'src/server/voxel_procedural.c',
],
dependencies: [
common,
dependency('sqlite3'),
],
install: true,
)