Replace build scripts with CMake

Rebuilding everything each time was getting a bit slow.
This commit is contained in:
2024-10-27 00:12:17 +01:00
parent 403d081e13
commit c58cabd2e6
6 changed files with 66 additions and 45 deletions

24
tests/CMakeLists.txt Normal file
View File

@@ -0,0 +1,24 @@
add_library(testing testing.c)
set_default_target_options(testing)
target_include_directories(testing PUBLIC include)
function(add_test_suite source)
string(REGEX REPLACE ".c$" "" name ${source})
add_executable(${name} ${source})
set_default_target_options(${name})
target_link_libraries(${name} PRIVATE lib testing)
add_test(NAME ${name} COMMAND ${name})
endfunction()
function(add_test_suites)
foreach(source ${ARGN})
add_test_suite(${source})
endforeach()
endfunction()
add_test_suites(
construct_tests.c
desugar_tests.c
fsa_tests.c
parse_tests.c
)