cmake_minimum_required(VERSION 3.31)
project(InsomniaSDL)

set(CMAKE_SKIP_INSTALL_RPATH OFF)
set(CMAKE_BUILD_WITH_INSTALL_RPATH ON)
set(CMAKE_INSTALL_RPATH "$ORIGIN")

find_package(SDL3 REQUIRED)
add_executable(insomnia insomnia.c)
target_link_libraries(insomnia SDL3)

if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
    target_link_libraries(insomnia mingw32)
    target_link_options(insomnia PRIVATE "-mwindows")
elseif (CMAKE_SYSTEM_NAME STREQUAL "Linux")
    add_definitions(-DLINUX)
endif()
