-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmeson.build
More file actions
102 lines (85 loc) · 1.91 KB
/
meson.build
File metadata and controls
102 lines (85 loc) · 1.91 KB
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
project(
'yar',
['c', 'cpp'],
default_options: [
'default_library=shared',
'c_std=c23',
'cpp_std=c++23',
'b_ndebug=if-release',
'warning_level=3',
]
)
cpp = meson.get_compiler('cpp')
host_system = host_machine.system()
buildtype = get_option('buildtype')
source_dir = meson.current_source_dir()
compiler_args = [
'-Wcast-align',
'-Wconversion',
'-Wdouble-promotion',
'-Wduplicated-branches',
'-Wduplicated-cond',
'-Wformat=2',
'-Wimplicit-fallthrough',
'-Wlogical-op',
'-Wmisleading-indentation',
'-Wnon-virtual-dtor',
'-Wnrvo',
'-Wnull-dereference',
'-Wold-style-cast',
'-Woverloaded-virtual',
'-Wshadow',
'-Wsign-conversion',
'-Wsuggest-override',
'-Wunused',
'-Wuseless-cast',
'-DGLM_FORCE_DEPTH_ZERO_TO_ONE',
'-m64',
]
linker_args = [
'-m64',
]
# OS
if host_system == 'windows'
compiler_args += [
'-D_WINDOWS',
]
compiler_args += [
'-DWIN64',
'-D_WIN64',
]
elif host_system == 'linux'
compiler_args += [
'-DLINUX',
'-D_LINUX',
'-DPOSIX',
]
endif
add_project_arguments(cpp.get_supported_arguments(compiler_args), language: 'cpp')
add_project_link_arguments(cpp.get_supported_link_arguments(linker_args), language: 'cpp')
includes = include_directories(
'thirdparty/vulkan-headers/include',
'thirdparty/VulkanMemoryAllocator/include',
'thirdparty/glm',
'thirdparty/imgui',
'thirdparty/imgui/backends',
is_system: true,
)
# TODO: is there a way to disable warnings for these?
imgui_src = [
'thirdparty/imgui/imgui.cpp',
'thirdparty/imgui/imgui_demo.cpp',
'thirdparty/imgui/imgui_draw.cpp',
'thirdparty/imgui/imgui_tables.cpp',
'thirdparty/imgui/imgui_widgets.cpp',
'thirdparty/imgui/backends/imgui_impl_sdl3.cpp',
'thirdparty/imgui/backends/imgui_impl_vulkan.cpp',
]
subdir('src')
subdir('assets')
executable(
'yar',
yar_src + imgui_src,
dependencies: yar_deps,
include_directories: includes,
)