Create demo application

This commit is contained in:
2025-08-10 17:27:23 +01:00
parent 9df53c63c5
commit 6077cf571d
3 changed files with 19 additions and 0 deletions

View File

@@ -3,6 +3,7 @@ cmake_minimum_required(VERSION 3.15)
project(imp LANGUAGES C) project(imp LANGUAGES C)
option(TESTS "Build tests" ON) option(TESTS "Build tests" ON)
option(DEMO "Build demo" ON)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON) set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
@@ -23,3 +24,7 @@ if (${TESTS})
add_subdirectory(dep/unity) add_subdirectory(dep/unity)
add_subdirectory(tests) add_subdirectory(tests)
endif() endif()
if (${DEMO})
add_subdirectory(demo)
endif()

5
demo/CMakeLists.txt Normal file
View File

@@ -0,0 +1,5 @@
add_executable(repl
main.c
)
configure_target(repl)
target_link_libraries(repl PRIVATE imp)

9
demo/main.c Normal file
View File

@@ -0,0 +1,9 @@
#include "repl.h"
static repl_t repl;
int main(void)
{
repl_init(&repl);
return repl_run(&repl);
}