-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
64 lines (55 loc) · 1.59 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
cmake_minimum_required(VERSION 3.29)
#
# Library
#
add_library(Engine STATIC
"Common/Debug/Assert.cpp"
"Common/Logger/Logger.cpp"
"Common/Logger/LoggerMessage.cpp"
"Common/Logger/LoggerFormat.cpp"
"Memory/MemoryStats.cpp"
"Memory/Allocators/DefaultAllocator.cpp"
"Platform/Memory.cpp"
"Platform/Time.cpp"
"Platform/CommandLine.cpp"
"Platform/Window.cpp"
"Graphics/GraphicsSystem.cpp"
"Graphics/GraphicsStats.cpp"
"Graphics/Vulkan/VulkanAllocator.cpp"
"Graphics/Vulkan/GraphicsSystem.cpp"
"Engine.cpp"
)
setup_cmake_build_version(Engine)
if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
target_sources(Engine PRIVATE
"Platform/Windows/Debug.cpp"
"Platform/Windows/Thread.cpp"
"Platform/Windows/Memory.cpp"
"Platform/Windows/Time.cpp"
"Platform/Windows/Window.cpp"
)
elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
target_sources(Engine PRIVATE
"Platform/Linux/Debug.cpp"
"Platform/Linux/Thread.cpp"
"Platform/Linux/Memory.cpp"
"Platform/Linux/Time.cpp"
"Platform/Linux/Window.cpp"
)
else()
message(FATAL_ERROR "Unsupported platform!")
endif()
target_include_directories(Engine
PUBLIC "${CMAKE_CURRENT_BINARY_DIR}"
PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}"
)
target_precompile_headers(Engine PRIVATE "Shared.hpp")
#
# Dependencies
#
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
target_link_libraries(Engine PRIVATE xcb)
endif()
find_package(Vulkan REQUIRED)
target_include_directories(Engine PUBLIC ${Vulkan_INCLUDE_DIRS})
target_link_libraries(Engine PRIVATE Vulkan::Vulkan)