34 lines
708 B
CMake
34 lines
708 B
CMake
cmake_minimum_required(VERSION 3.7...3.10)
|
|
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
|
|
|
project(tetris)
|
|
enable_language(C)
|
|
|
|
find_package(SDL3 REQUIRED CONFIG REQUIRED COMPONENTS SDL3-shared)
|
|
|
|
add_executable(tetris
|
|
main.c
|
|
src/game.c
|
|
src/grid.c
|
|
src/shape.c
|
|
src/input.c
|
|
|
|
# Rendering
|
|
src/render.c
|
|
src/render/tile.c
|
|
src/render/text.c
|
|
)
|
|
|
|
target_compile_definitions(tetris PRIVATE
|
|
$<$<CONFIG:Debug>:APP_DEBUG=1>
|
|
)
|
|
|
|
target_include_directories(tetris PUBLIC
|
|
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
|
|
)
|
|
|
|
# SDL TTF
|
|
set(SDLTTF_VENDORED ON)
|
|
add_subdirectory(vendor/SDL3_ttf-3.2.2 EXCLUDE_FROM_ALL)
|
|
|
|
target_link_libraries(tetris PRIVATE SDL3_ttf::SDL3_ttf SDL3::SDL3)
|