From 446ee993065aacb35b8e635bddeb4a90959695ff Mon Sep 17 00:00:00 2001 From: Max Wash Date: Sun, 24 May 2026 20:25:51 +0100 Subject: [PATCH] build: add new sub-directories --- CMakeLists.txt | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5960a69..61889b1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,6 +3,10 @@ project(bshell C) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake) +if (NOT DEFINED bshell_interactive) + set(bshell_interactive 1) +endif () + find_package(Python COMPONENTS Interpreter REQUIRED) find_package(FX REQUIRED COMPONENTS fx.runtime @@ -14,14 +18,33 @@ execute_process( ${CMAKE_CURRENT_SOURCE_DIR}/tools/build-id.py OUTPUT_VARIABLE bshell_version) -file(GLOB_RECURSE bshell_sources +set(source_dirs + ast compile parse parse/lex parse/syntax + runtime format command cmdlets aliases) + +if (bshell_interactive EQUAL 1) + message(STATUS "Interactive support: Enabled") + set(source_dirs ${source_dirs} line-ed) +else () + message(STATUS "Interactive support: Disabled") +endif () + +file(GLOB bshell_sources bshell/*.c bshell/*.h) +foreach (d ${source_dirs}) + file(GLOB sources + bshell/${d}/*.c + bshell/${d}/*.h) + set(bshell_sources ${bshell_sources} ${sources}) +endforeach (d) + message(STATUS "B Shell version: ${bshell_version}") add_executable(bshell ${bshell_sources}) target_link_libraries(bshell FX::Runtime FX::Collections FX::Term) target_compile_definitions(bshell PUBLIC - BSHELL_VERSION="${bshell_version}") + BSHELL_VERSION="${bshell_version}" + BSHELL_INTERACTIVE=${bshell_interactive})