Files
bshell/CMakeLists.txt
T

51 lines
1.2 KiB
CMake
Raw Normal View History

2026-05-02 12:52:32 +01:00
cmake_minimum_required(VERSION 3.31)
project(bshell C)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
2026-05-24 20:25:51 +01:00
if (NOT DEFINED bshell_interactive)
set(bshell_interactive 1)
endif ()
2026-05-02 12:52:32 +01:00
find_package(Python COMPONENTS Interpreter REQUIRED)
find_package(FX REQUIRED COMPONENTS
fx.runtime
fx.collections
fx.term)
2026-05-02 12:52:32 +01:00
execute_process(
COMMAND ${Python_EXECUTABLE}
${CMAKE_CURRENT_SOURCE_DIR}/tools/build-id.py
OUTPUT_VARIABLE bshell_version)
2026-05-24 20:25:51 +01:00
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
2026-05-02 12:52:32 +01:00
bshell/*.c
bshell/*.h)
2026-05-24 20:25:51 +01:00
foreach (d ${source_dirs})
file(GLOB sources
bshell/${d}/*.c
bshell/${d}/*.h)
set(bshell_sources ${bshell_sources} ${sources})
endforeach (d)
2026-05-02 12:52:32 +01:00
message(STATUS "B Shell version: ${bshell_version}")
add_executable(bshell ${bshell_sources})
target_link_libraries(bshell FX::Runtime FX::Collections FX::Term)
2026-05-02 12:52:32 +01:00
target_compile_definitions(bshell PUBLIC
2026-05-24 20:25:51 +01:00
BSHELL_VERSION="${bshell_version}"
BSHELL_INTERACTIVE=${bshell_interactive})