Add primitives, hash map and dynamic array

This commit is contained in:
Hugo Mårdbrink 2025-04-17 09:53:37 +02:00
commit 2f19f82116
10 changed files with 384 additions and 0 deletions

31
CMakeLists.txt Normal file
View file

@ -0,0 +1,31 @@
cmake_minimum_required(VERSION 3.21)
project(htd C)
set(CMAKE_C_STANDARD 23)
set(CMAKE_C_STANDARD_REQUIRED YES)
set(CMAKE_C_EXTENSIONS NO)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
file(GLOB HTD_SOURCES
src/data_structure/*.c
)
add_library(htd STATIC ${HTD_SOURCES})
target_include_directories(htd PUBLIC
${PROJECT_SOURCE_DIR}/include
)
target_compile_options(htd PRIVATE -Wall -Wextra -Werror)
set(CMAKE_CTEST_VERBOSE TRUE)
enable_testing()
file(GLOB TEST_SOURCES tests/test_*.c)
foreach(test_src ${TEST_SOURCES})
get_filename_component(test_name ${test_src} NAME_WE)
add_executable(${test_name} ${test_src})
target_link_libraries(${test_name} PRIVATE htd)
add_test(NAME ${test_name} COMMAND ${test_name})
endforeach()