2026-03-29 10:40:09 -06:00
|
|
|
cmake_minimum_required(VERSION 3.20)
|
|
|
|
|
project(calculator VERSION 1.0 LANGUAGES C)
|
|
|
|
|
|
|
|
|
|
set(CMAKE_C_STANDARD 11)
|
|
|
|
|
set(CMAKE_C_STANDARD_REQUIRED ON)
|
|
|
|
|
|
|
|
|
|
# Export compile_commands.json (para clangd)
|
|
|
|
|
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
|
|
|
|
|
|
|
|
|
add_compile_options(
|
|
|
|
|
-Wall
|
|
|
|
|
-Wextra
|
|
|
|
|
-Wpedantic
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
include_directories(include)
|
|
|
|
|
|
|
|
|
|
add_library(arena_lib
|
|
|
|
|
src/arena.c
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
add_executable(arena_main src/main.c)
|
|
|
|
|
|
|
|
|
|
target_link_libraries(arena_main arena_lib)
|
|
|
|
|
|
refactor(all): Fixed alloc and moved growing logic to another function
OK, so evrything was a fucknig mess, it still kinda is, AI helped
me to clean my own mess, it really sucks but the fucking debugger
and address sanitizer were not working, also, there were small
small errors so no big deal but still, a bit sad, also changed a
the way i cast from uint8_t to double and int in the tests, may
change that i guess, verything else i might say is good :)
2026-04-03 12:44:01 -06:00
|
|
|
function(enable_sanitizers target)
|
|
|
|
|
target_compile_options(${target} PRIVATE -fsanitize=address -fno-omit-frame-pointer)
|
|
|
|
|
target_link_options(${target} PRIVATE -fsanitize=address)
|
|
|
|
|
endfunction()
|
|
|
|
|
|
|
|
|
|
|
2026-03-29 10:40:09 -06:00
|
|
|
# ------------------------
|
|
|
|
|
# Testing
|
|
|
|
|
# ------------------------
|
|
|
|
|
|
|
|
|
|
enable_testing()
|
|
|
|
|
add_subdirectory(test)
|
|
|
|
|
|