forked from eliasdaler/edbr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
279 lines (242 loc) · 6.53 KB
/
CMakeLists.txt
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
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
add_subdirectory(third_party)
add_subdirectory(tools)
add_library(edbr
# Core
src/Core/JsonDataLoader.cpp
src/Core/JsonFile.cpp
src/Core/JsonMath.cpp
src/Core/JsonGraphics.cpp
# DevTools
src/DevTools/ActionListInspector.cpp
src/DevTools/EntityInfoDisplayer.cpp
src/DevTools/EntityTreeView.cpp
src/DevTools/Im3dState.cpp
src/DevTools/ImGuiPropertyTable.cpp
src/DevTools/JoltDebugRenderer.cpp
src/DevTools/ResourcesInspector.cpp
src/DevTools/UIInspector.cpp
# Event
src/Event/Event.cpp
src/Event/EventManager.cpp
src/Event/ListenerInfo.cpp
# ECS
src/ECS/ComponentFactory.cpp
src/ECS/EntityFactory.cpp
src/ECS/Systems/MovementSystem.cpp
src/ECS/Systems/TransformSystem.cpp
# Math
src/Math/IndexRange2.cpp
src/Math/Transform.cpp
src/Math/Util.cpp
# Graphics/Vulkan
src/Graphics/Vulkan/BindlessSetManager.cpp
src/Graphics/Vulkan/Descriptors.cpp
src/Graphics/Vulkan/Init.cpp
src/Graphics/Vulkan/Pipelines.cpp
src/Graphics/Vulkan/Swapchain.cpp
src/Graphics/Vulkan/Util.cpp
src/Graphics/Vulkan/VmaImpl.cpp
src/Graphics/Vulkan/VolkImpl.cpp
src/Graphics/Vulkan/VulkanImGuiBackend.cpp
src/Graphics/Vulkan/VulkanImmediateExecutor.cpp
# Graphics
src/Graphics/Bouncer.cpp
src/Graphics/Camera.cpp
src/Graphics/Color.cpp
src/Graphics/Cubemap.cpp
src/Graphics/Font.cpp
src/Graphics/FrustumCulling.cpp
src/Graphics/GfxDevice.cpp
src/Graphics/ImageCache.cpp
src/Graphics/ImageLoader.cpp
src/Graphics/Letterbox.cpp
src/Graphics/MaterialCache.cpp
src/Graphics/MeshCache.cpp
src/Graphics/MipMapGeneration.cpp
src/Graphics/NBuffer.cpp
src/Graphics/Scene.cpp
src/Graphics/ShadowMapping.cpp
src/Graphics/SkeletonAnimator.cpp
src/Graphics/SkeletalAnimation.cpp
src/Graphics/SkeletalAnimationCache.cpp
src/Graphics/Sprite.cpp
src/Graphics/SpriteAnimator.cpp
src/Graphics/SpriteAnimationData.cpp
# Graphics/Pipeline
src/Graphics/Pipelines/CSMPipeline.cpp
src/Graphics/Pipelines/DepthResolvePipeline.cpp
src/Graphics/Pipelines/MeshPipeline.cpp
src/Graphics/Pipelines/PostFXPipeline.cpp
src/Graphics/Pipelines/SkinningPipeline.cpp
src/Graphics/Pipelines/SkyboxPipeline.cpp
src/Graphics/Pipelines/SpriteDrawingPipeline.cpp
# Graphics - high level renderers
src/Graphics/GameRenderer.cpp
src/Graphics/SpriteRenderer.cpp
# Text
src/Text/TextManager.cpp
# Util
src/Util/CameraUtil.cpp
src/Util/GltfLoader.cpp
src/Util/Im3dUtil.cpp
src/Util/ImGuiUtil.cpp
src/Util/InputUtil.cpp
src/Util/MetaUtil.cpp
src/Util/OSUtil.cpp
src/Util/Palette.cpp
src/Util/StringUtil.cpp
src/Input/ActionMapping.cpp
src/Input/ButtonState.cpp
src/Input/GamepadState.cpp
src/Input/InputManager.cpp
src/Input/InputStringMap.cpp
src/Input/KeyboardState.cpp
src/Input/MouseState.cpp
# Audio
src/Audio/AudioManager.cpp
src/Audio/Music.cpp
src/Audio/OpenALUtil.cpp
src/Audio/Sound.cpp
src/Audio/SoundBuffer.cpp
src/Audio/SoundDevice.cpp
src/Audio/WavLoader.cpp
# UI
src/UI/ButtonElement.cpp
src/UI/Element.cpp
src/UI/ImageElement.cpp
src/UI/InputEvent.cpp
src/UI/ListLayoutElement.cpp
src/UI/NineSlice.cpp
src/UI/NineSliceElement.cpp
src/UI/Style.cpp
src/UI/TextElement.cpp
src/UI/UIRenderer.cpp
# Game UI
src/GameUI/Cursor.cpp
src/GameUI/DialogueBox.cpp
src/GameUI/MenuStack.cpp
# ActionList
src/ActionList/ActionList.cpp
src/ActionList/ActionListManager.cpp
src/ActionList/ActionWrappers.cpp
# ActionList - default actions
src/ActionList/Actions/ActionListFinishAction.cpp
src/ActionList/Actions/DelayAction.cpp
src/ActionList/Actions/DoAction.cpp
src/ActionList/Actions/MakeAction.cpp
src/ActionList/Actions/ParallelActionListsFinishAction.cpp
src/ActionList/Actions/TweenAction.cpp
src/ActionList/Actions/WaitWhileAction.cpp
# Camera
src/Camera/FreeCameraController.cpp
src/Camera/CameraActions.cpp
src/Camera/CameraManager.cpp
# Save
src/Save/SaveFile.cpp
src/Save/SaveFileManager.cpp
# TileMap
src/TileMap/TileMap.cpp
src/TileMap/TileMapRenderer.cpp
src/TileMap/TiledImporter.cpp
# GameCommon
src/GameCommon/CommonComponentDisplayers.cpp
src/GameCommon/CommonComponentDisplayers2D.cpp
src/GameCommon/CommonComponentLoaders.cpp
src/GameCommon/CommonComponentLoaders2D.cpp
src/GameCommon/DialogueActions.cpp
src/GameCommon/EntityUtil2D.cpp
src/GameCommon/EntityUtil.cpp
src/Application.cpp
src/SceneCache.cpp
)
add_library(edbr::edbr ALIAS edbr)
set_target_properties(edbr PROPERTIES
CXX_STANDARD 20
CXX_EXTENSIONS OFF
)
target_add_extra_warnings(edbr)
target_include_directories(edbr PUBLIC "${CMAKE_CURRENT_LIST_DIR}/include")
target_link_libraries(edbr
PUBLIC
volk::volk_headers
vk-bootstrap::vk-bootstrap
GPUOpen::VulkanMemoryAllocator
fmt::fmt
glm::glm
nlohmann_json::nlohmann_json
utf8cpp::utf8cpp
EnTT::EnTT
imgui::imgui
im3d::im3d
Jolt::Jolt
# audio
OpenAL::OpenAL
Ogg::ogg
vorbis::vorbis
vorbis::vorbisfile
CLI11::CLI11
PRIVATE
tinygltf::tinygltf
stb::image
freetype::freetype
)
target_compile_definitions(edbr PUBLIC AL_ALEXT_PROTOTYPES)
target_compile_definitions(edbr
PUBLIC
VK_NO_PROTOTYPES
VMA_VULKAN_VERSION=1003000
# VOLK_DEFAULT_VISIBILITY # FIXME: doesn't work for some reason
)
# SDL
if(BUILD_SHARED_LIBS)
target_link_libraries(edbr PUBLIC
SDL2::SDL2
)
else()
target_link_libraries(edbr PUBLIC
SDL2::SDL2-static
)
endif()
if(WIN32)
target_link_libraries(edbr PRIVATE SDL2::SDL2main)
endif()
# glm
target_compile_definitions(edbr
PUBLIC
GLM_FORCE_CTOR_INIT
GLM_FORCE_XYZW_ONLY
GLM_FORCE_EXPLICIT_CTOR
GLM_FORCE_DEPTH_ZERO_TO_ONE
GLM_ENABLE_EXPERIMENTAL
)
target_compile_definitions(edbr
PUBLIC
JPH_DEBUG_RENDERER
)
target_link_libraries(edbr PUBLIC Tracy::TracyClient)
if (MSVC)
target_compile_definitions(TracyClient PUBLIC
$<$<CONFIG:Debug,RelWithDebInfo>:TRACY_ENABLE>
$<$<CONFIG:Debug,RelWithDebInfo>:TRACY_DELAYED_INIT> # for unit tests to work
)
else()
if(NOT CMAKE_BUILD_TYPE OR
CMAKE_BUILD_TYPE STREQUAL "Debug" OR
CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")
target_compile_definitions(TracyClient PUBLIC
TRACY_ENABLE
TRACY_DELAYED_INIT # needed for unit tests to work
)
endif()
endif()
## testing
include(CTest)
if(EDBR_BUILD_TESTING)
enable_testing()
if(NOT MSVC)
add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure)
else()
add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} -C Debug --output-on-failure)
endif()
add_subdirectory(test)
endif()