ad8b284869
the line editor supports custom keybinds and data storage, allowing for
a wide range of functionality to be implemented via plugins.
included plugins include:
* core: basic input and cursor movement.
* history: input history storage and retrieval (unfinished)
* highlight: support for colour-highlighting the line buffer (unfinished)
* syntax: parses the line buffer and uses `highlight` to apply syntax highlighting (unfinished).
* shell-integration:
- allows a `prompt` function to be defined, which will be called to get the text to
be used for the prompt
- exposes key properties of the line editor to the shell environment, allowing line editor
functionality to be extended via shell scripts.
30 lines
780 B
CMake
30 lines
780 B
CMake
set(source_dirs
|
|
ast compile parse parse/lex parse/syntax
|
|
format runtime command line-editor)
|
|
|
|
file(GLOB sources
|
|
*.c
|
|
*.h)
|
|
|
|
foreach (d ${source_dirs})
|
|
file(GLOB d_sources
|
|
${d}/*.c
|
|
${d}/*.h)
|
|
set(sources ${sources} ${d_sources})
|
|
endforeach (d)
|
|
|
|
add_library(bshell.runtime SHARED ${sources})
|
|
|
|
target_link_libraries(bshell.runtime FX::Runtime FX::Collections FX::Io FX::Diagnostics)
|
|
|
|
if (bshell_interactive)
|
|
target_link_libraries(bshell.runtime FX::Term)
|
|
endif ()
|
|
|
|
target_include_directories(bshell.runtime PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include)
|
|
target_compile_definitions(bshell.runtime PUBLIC
|
|
BSHELL_VERSION="${bshell_version}"
|
|
BSHELL_ENABLE_FLOATING_POINT=${bshell_enable_floating_point}
|
|
BSHELL_INTERACTIVE=${bshell_interactive}
|
|
BSHELL_VERBOSE=${bshell_verbose})
|