-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
51 lines (39 loc) · 1.23 KB
/
CMakeLists.txt
File metadata and controls
51 lines (39 loc) · 1.23 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
cmake_minimum_required(VERSION 3.20)
project(Caffeine VERSION 0.1.0 LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
add_compile_definitions(CF_DEBUG)
endif()
# ── SDL3 (optional – RHI is only built when SDL3 is available) ──
find_package(SDL3 CONFIG QUIET)
add_library(Caffeine
src/core/Timer.cpp
src/core/GameLoop.cpp
src/input/InputManager.cpp
src/debug/LogSystem.cpp
src/debug/Profiler.cpp
src/threading/JobSystem.cpp
)
if(SDL3_FOUND)
target_sources(Caffeine PRIVATE
src/rhi/RenderDevice.cpp
src/rhi/CommandBuffer.cpp
)
endif()
target_include_directories(Caffeine PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>
$<INSTALL_INTERFACE:include>
)
if(SDL3_FOUND)
target_link_libraries(Caffeine PUBLIC SDL3::SDL3)
target_compile_definitions(Caffeine PUBLIC CF_HAS_SDL3=1)
message(STATUS "SDL3 found – RHI module enabled")
else()
message(STATUS "SDL3 not found – RHI module disabled")
endif()
target_compile_features(Caffeine PUBLIC cxx_std_20)
add_library(Caffeine::Core ALIAS Caffeine)
add_subdirectory(tests)