From e6d59a7b506f610b82340b62457f9dd9ad0cb53d Mon Sep 17 00:00:00 2001 From: Felix Morgner Date: Thu, 19 Feb 2026 13:30:45 +0100 Subject: feat: integrate basic CMocka tests --- CMakeLists.txt | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 9e2baef..7f97d30 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,15 +6,29 @@ project("snake.s" LANGUAGES ASM ) +option(SNAKE_BUILD_TESTS "Build the snake.s tests" ON) + add_subdirectory("libs") -add_executable("snake.s" +add_library("snake.core" "src/error.S" - "src/main.S" + "src/snake.S" +) + +target_include_directories("snake.core" PUBLIC + "src" ) -target_link_libraries("snake.s" PRIVATE +target_link_libraries("snake.core" PUBLIC "bindings::SDL2" ) +add_executable("snake.s" "src/main.S") + +target_link_libraries("snake.s" PRIVATE "snake.core") + install(TARGETS "snake.s") + +if(SNAKE_BUILD_TESTS) + add_subdirectory("tests") +endif() \ No newline at end of file -- cgit v1.2.3