Create demo application
This commit is contained in:
@@ -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()
|
||||
|
||||
5
demo/CMakeLists.txt
Normal file
5
demo/CMakeLists.txt
Normal 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
9
demo/main.c
Normal file
@@ -0,0 +1,9 @@
|
||||
#include "repl.h"
|
||||
|
||||
static repl_t repl;
|
||||
|
||||
int main(void)
|
||||
{
|
||||
repl_init(&repl);
|
||||
return repl_run(&repl);
|
||||
}
|
||||
Reference in New Issue
Block a user