From 6077cf571d7f96202181da5eee80fceeb1ba709e Mon Sep 17 00:00:00 2001 From: Camden Dixie O'Brien Date: Sun, 10 Aug 2025 17:27:23 +0100 Subject: [PATCH] Create demo application --- CMakeLists.txt | 5 +++++ demo/CMakeLists.txt | 5 +++++ demo/main.c | 9 +++++++++ 3 files changed, 19 insertions(+) create mode 100644 demo/CMakeLists.txt create mode 100644 demo/main.c diff --git a/CMakeLists.txt b/CMakeLists.txt index e66376a..9d8ea0f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,6 +3,7 @@ cmake_minimum_required(VERSION 3.15) project(imp LANGUAGES C) option(TESTS "Build tests" ON) +option(DEMO "Build demo" ON) set(CMAKE_EXPORT_COMPILE_COMMANDS ON) @@ -23,3 +24,7 @@ if (${TESTS}) add_subdirectory(dep/unity) add_subdirectory(tests) endif() + +if (${DEMO}) + add_subdirectory(demo) +endif() diff --git a/demo/CMakeLists.txt b/demo/CMakeLists.txt new file mode 100644 index 0000000..a28c276 --- /dev/null +++ b/demo/CMakeLists.txt @@ -0,0 +1,5 @@ +add_executable(repl + main.c +) +configure_target(repl) +target_link_libraries(repl PRIVATE imp) diff --git a/demo/main.c b/demo/main.c new file mode 100644 index 0000000..4997190 --- /dev/null +++ b/demo/main.c @@ -0,0 +1,9 @@ +#include "repl.h" + +static repl_t repl; + +int main(void) +{ + repl_init(&repl); + return repl_run(&repl); +}