-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmeson.build
More file actions
201 lines (178 loc) · 6.22 KB
/
Copy pathmeson.build
File metadata and controls
201 lines (178 loc) · 6.22 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
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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
project('Pistachio-Engine', 'cpp',
default_options: ['cpp_std=c++20'])
deps_required = not get_option('fetch_dependencies')
args = ['-DPAL_STDCPP_COMPAT','-D_DEBUG']
cmake = import('cmake')
yaml_dep = dependency('yaml-cpp', required: deps_required)
if not yaml_dep.found()
yaml_cpp = cmake.subproject('yaml-cpp')
yaml_dep = yaml_cpp.dependency('yaml-cpp')
endif
assimp_dep = dependency('assimp')
rhi = subproject('RHI')
rhi_dep = rhi.get_variable('rhi_dep')
pktx = subproject('pktx')
pktx_dep = pktx.get_variable('pktx_dep')
rhi_sc = subproject('rhi_sc')
rhi_sc_dep = rhi_sc.get_variable('rhi_sc_dep')
rhi_sc_exe = rhi_sc.get_variable('rhi_sc_exe')
imgui_dep = dependency('imgui')
spdlog_dep = dependency('spdlog')
xxhash_dep = dependency('libxxhash')
# Normally we would depend on ezr but RHI provides it
# ezr = subproject('ezr')
# ezr_dep = ezr.get_variable('ezr_dep')
deps = [
rhi_dep,
yaml_dep,
assimp_dep,
imgui_dep,
spdlog_dep,
xxhash_dep,
pktx_dep,
rhi_sc_dep,]
if(get_option('profiler_support') == 'tracy')
tracy = subproject('tracy')
tracy_dep = tracy.get_variable('tracy_dep')
deps += tracy_dep
args += '-DPT_PROFILE_TRACY'
elif (get_option('profiler_support') == 'json')
args += '-DPT_PROFILE_JSON'
endif
inc_dirs = ['src/',
'vendor/entt/include/',
'vendor/SimpleMath',
'vendor/stb_image/',
'vendor/DirectXMath/',]
if(build_machine.system() != 'windows')
inc_dirs += 'vendor/sal'
endif
sources = [
'src/Pistachio/Core/UUID.cpp',
'src/Pistachio/Core/Layer.cpp',
'src/Pistachio/Core/LayerStack.cpp',
'src/Pistachio/Core/FileSystem.cpp',
'src/Pistachio/Core/Application.cpp',
'src/Pistachio/Core/Log.cpp',
'src/Pistachio/Core/Input.cpp',
'src/Pistachio/Core/Transform.cpp',
'src/Pistachio/Core/SwapChain.cpp',
'src/Pistachio/Core/InputCallbacks.cpp',
'src/Pistachio/Scene/CullingManager.cpp',
'src/Pistachio/Scene/Scene.cpp',
'src/Pistachio/Scene/Components.cpp',
'src/Pistachio/Scene/Entity.cpp',
'src/Pistachio/Scene/SceneSerializer.cpp',
'src/Pistachio/Renderer/ShaderAssetCompiler.cpp',
'src/Pistachio/Renderer/FrameComposer.cpp',
'src/Pistachio/Renderer/RenderGraph.cpp',
'src/Pistachio/Renderer/Renderer2D.cpp',
'src/Pistachio/Renderer/RendererContext.cpp',
'src/Pistachio/Renderer/Model.cpp',
'src/Pistachio/Renderer/ShaderAsset.cpp',
'src/Pistachio/Renderer/Renderer.cpp',
'src/Pistachio/Renderer/Camera.cpp',
'src/Pistachio/Renderer/Shader.cpp',
'src/Pistachio/Renderer/Buffer.cpp',
'src/Pistachio/Renderer/Texture.cpp',
'src/Pistachio/Renderer/EditorCamera.cpp',
'src/Pistachio/Renderer/MeshFactory.cpp',
'src/Pistachio/Renderer/RenderTexture.cpp',
'src/Pistachio/Renderer/RendererBase.cpp',
'src/Pistachio/Renderer/Mesh.cpp',
'src/Pistachio/Renderer/Skybox.cpp',
'src/Pistachio/Renderer/Cubemap.cpp',
'src/Pistachio/Renderer/Material.cpp',
'src/Pistachio/Asset/AssetManager.cpp',
'src/Pistachio/Physics/Physics.cpp',
'src/Pistachio/Allocators/FreeList.cpp',
'src/Pistachio/Allocators/AtlasAllocator.cpp',
'src/Pistachio/Utils/RendererUtils.cpp',
'vendor/SimpleMath/SimpleMath.cpp', #we don't need the entire DXTK
'vendor/stb_image/stb_image.cpp'
]
tests_src = [
'tests/engine_test.cpp'
]
shaders_dir = 'src/Pistachio/Renderer/shaders/'
vertex_shaders = [
'background_vs.hlsl',
'prefilter_vs.hlsl',
'StandaloneVertexShader.hlsl',
'vertex_shader_no_transform.hlsl',
'equirectangular_to_cubemap_vs.hlsl',
'Shadow_vs.hlsl',
'VertexShader.hlsl'
]
pixel_shaders = [
'background_ps.hlsl',
'CFPBRShader_ps.hlsl',
'equirectangular_to_cubemap_fs.hlsl',
'irradiance_fs.hlsl',
'prefilter_fs.hlsl',
'Shadow_ps.hlsl',
]
compute_shaders = [
'BRDF_LUT_cs.hlsl',
'CFActiveClusters_cs.hlsl',
'CFBuildClusters_cs.hlsl',
'CFCullLights_cs.hlsl',
'CFTightenList_cs.hlsl',
'EqToCubeMap_cs.hlsl',
#'src/Pistachio/Renderer/shaders/compute/Irradiance_cs.hlsl',
]
vs_args = [rhi_sc_exe, '-i', '@INPUT@', '-o', '@OUTPUT@', '-ONone', '-g', '-t', 'vertex']
ps_args = [rhi_sc_exe, '-i', '@INPUT@', '-o', '@OUTPUT@', '-ONone', '-g', '-t', 'pixel']
cs_args = [rhi_sc_exe, '-i', '@INPUT@', '-o', '@OUTPUT@', '-ONone', '-g', '-t', 'compute']
vs_output = []
vs_input = []
ps_output = []
ps_input = []
cs_output = []
cs_input = []
foreach shader : vertex_shaders
vs_output += (shader.substring(0, -5) + '.rbc') #replace .hlsl with .rbc
vs_input += shaders_dir / 'vertex' / shader
endforeach
foreach shader : pixel_shaders
ps_output += (shader.substring(0, -5) + '.rbc')
ps_input += shaders_dir / 'pixel' / shader
endforeach
foreach shader : compute_shaders
cs_output += (shader.substring(0, -5) + '.rbc')
cs_input += shaders_dir / 'compute' / shader
endforeach
custom_target('Vertex Shaders', command: vs_args, input: vs_input,output: vs_output)
custom_target('Pixel Shaders', command: ps_args, input: ps_input,output: ps_output)
custom_target('Compute Shaders', command: cs_args, input: cs_input, output: cs_output)
if(build_machine.system() == 'linux')
glfw3_dep = dependency('glfw3')
deps += glfw3_dep
args += '-DUSE_GLFW'
args += '-DPT_PLATFORM_LINUX'
sources += 'src/Pistachio/Platform/Linux/LinuxWindow.cpp'
sources += 'src/Pistachio/Platform/Linux/LinuxInputPoll.cpp'
endif
if(build_machine.system() == 'windows')
sources += 'src/Pistachio/Platform/Windows/WindowsWindow.cpp'
sources += 'src/Pistachio/Platform/Windows/WindowsInputPoll.cpp'
args += '-DNOMINMAX'
args += '-DPT_PLATFORM_WINDOWS'
endif
if(get_option('verbose_logging') == true)
args += '-DPT_VERBOSE'
endif
if(get_option('use_magic_enum') == true)
deps += dependency('magic_enum')
args += '-DPT_USE_MENUM'
endif
add_project_arguments(args,language: 'cpp',)
inc = include_directories(inc_dirs)
args = ['-DPISTACHIO_BUILD_DLL']
if get_option('using_dll')
args += ['USE_DLL']
endif
lib = library('Pistachio',sources,include_directories:inc,dependencies:deps,
override_options: ['cpp_std=c++20'], cpp_args: args)
pistachio_dep = declare_dependency(include_directories:inc, link_with:lib, dependencies: deps)
executable('Pistachio-Tests', tests_src, dependencies: [pistachio_dep, dependency('catch2-with-main')])