-
Notifications
You must be signed in to change notification settings - Fork 0
/
meson.build
112 lines (104 loc) · 2.52 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
project('luma', 'cpp',
version: '0.0.1',
default_options: [
'cpp_std=c++20',
'warning_level=3',
'werror=true'
]
)
add_project_arguments('-Wno-deprecated-volatile', language: 'cpp')
cpp = meson.get_compiler('cpp')
core_deps = []
if build_machine.system() == 'darwin'
core_deps += [dependency('appleframeworks', modules: [
'Cocoa',
'IOKit',
'CoreVideo',
'OpenGL'
])]
endif
# Precompiled library
glfw_path = get_option('glfw')
glfw = declare_dependency(
dependencies: cpp.find_library('glfw3', dirs: join_paths(glfw_path, 'build/src')),
include_directories: join_paths(glfw_path, 'include')
)
glad_path = get_option('glad')
glad = declare_dependency(
dependencies: cpp.find_library('glad', dirs: join_paths(glad_path, 'build')),
include_directories: join_paths(glad_path, 'include')
)
# Header library
stb_path = get_option('stb')
stb = declare_dependency(
include_directories: join_paths(stb_path)
)
glm_path = get_option('glm')
glm = declare_dependency(
include_directories: join_paths(glm_path)
)
# Compile external library
imgui_path = get_option('imgui')
imgui_inc = [
include_directories(imgui_path),
include_directories(join_paths(imgui_path, 'backends')),
]
imgui = declare_dependency(
include_directories: imgui_inc,
link_with: library(
'imgui',
[
join_paths(imgui_path, 'imgui.cpp'),
join_paths(imgui_path, 'imgui_demo.cpp'),
join_paths(imgui_path, 'imgui_draw.cpp'),
join_paths(imgui_path, 'imgui_tables.cpp'),
join_paths(imgui_path, 'imgui_widgets.cpp'),
# Backends
join_paths(imgui_path, 'backends/imgui_impl_glfw.h'),
join_paths(imgui_path, 'backends/imgui_impl_glfw.cpp'),
join_paths(imgui_path, 'backends/imgui_impl_opengl3.cpp'),
],
include_directories: imgui_inc,
dependencies: [glfw] + core_deps
),
)
executable(
'luma',
[ # ls src -1 --sort=extension
'src/buffer.hpp',
'src/camera.hpp',
'src/event.hpp',
'src/grid.hpp',
'src/image.hpp',
'src/input.hpp',
'src/luma.hpp',
'src/mesh.hpp',
'src/shader.hpp',
'src/texture.hpp',
'src/util.hpp',
'src/window.hpp',
'src/buffer.cpp',
'src/camera.cpp',
'src/grid.cpp',
'src/image.cpp',
'src/input.cpp',
'src/main.cpp',
'src/mesh.cpp',
'src/shader.cpp',
'src/texture.cpp',
'src/util.cpp',
'src/window.cpp',
], # source files
include_directories: [
'src'
],
dependencies: [
glfw,
glad,
stb,
glm,
imgui,
] + core_deps,
override_options: [
]
)