set(CMAKE_BUILD_TYPE "Debug")

cmake_minimum_required(VERSION 3.21)
project(rectangles-sdl3)

# Set the C standard
set(CMAKE_C_STANDARD 17)
set(CMAKE_C_STANDARD_REQUIRED ON)

# Specify the exact location of the library configuration files
# The variable name must strictly match: LibraryName_DIR
set(SDL3_DIR "C:/libs/SDL3-devel-3.4.10-wasm/lib/cmake/SDL3")

# Check for the presence of the library in the system
# If it is not found, CMake will abort the configuration with an error
# REQUIRED means the library is mandatory for the build
find_package(SDL3 REQUIRED)

# Set the name of the future application (on the web it will be app.js / app.wasm,
# while on Windows it would be app.exe)
add_executable(app)

# Add source code to the project
target_sources(app
    PRIVATE
    src/main.c
)
 
# Link the library to our application (configures linking and include paths)
target_link_libraries(app PRIVATE SDL3::SDL3)
