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 :)
40 lines
751 B
CMake
40 lines
751 B
CMake
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)
|
|
|
|
function(enable_sanitizers target)
|
|
target_compile_options(${target} PRIVATE -fsanitize=address -fno-omit-frame-pointer)
|
|
target_link_options(${target} PRIVATE -fsanitize=address)
|
|
endfunction()
|
|
|
|
|
|
# ------------------------
|
|
# Testing
|
|
# ------------------------
|
|
|
|
enable_testing()
|
|
add_subdirectory(test)
|
|
|