cmake_minimum_required(VERSION 3.20)

project(snake C)

set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})

include(FetchContent)

FetchContent_Declare(
  jag_parse
  GIT_REPOSITORY https://codeberg.org/Jaglekon/jag_parse.git
  GIT_TAG v1.1.0
)

FetchContent_Declare(
  jag_write
  GIT_REPOSITORY https://codeberg.org/Jaglekon/jag_write.git
  GIT_TAG v1.0.1
)

FetchContent_MakeAvailable(jag_parse jag_write)

add_executable(snake
  source/main.c
  source/logic.c
  source/draw.c
  source/parameters.c
)

target_link_libraries(snake PRIVATE 
  jag_parse 
  jag_write
)

target_compile_options(snake PRIVATE
  $<$<CONFIG:Debug>:-Wall -Wextra -Wpedantic>
)
