build: add new sub-directories
This commit is contained in:
+25
-2
@@ -3,6 +3,10 @@ project(bshell C)
|
|||||||
|
|
||||||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
|
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(Python COMPONENTS Interpreter REQUIRED)
|
||||||
find_package(FX REQUIRED COMPONENTS
|
find_package(FX REQUIRED COMPONENTS
|
||||||
fx.runtime
|
fx.runtime
|
||||||
@@ -14,14 +18,33 @@ execute_process(
|
|||||||
${CMAKE_CURRENT_SOURCE_DIR}/tools/build-id.py
|
${CMAKE_CURRENT_SOURCE_DIR}/tools/build-id.py
|
||||||
OUTPUT_VARIABLE bshell_version)
|
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/*.c
|
||||||
bshell/*.h)
|
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}")
|
message(STATUS "B Shell version: ${bshell_version}")
|
||||||
|
|
||||||
add_executable(bshell ${bshell_sources})
|
add_executable(bshell ${bshell_sources})
|
||||||
|
|
||||||
target_link_libraries(bshell FX::Runtime FX::Collections FX::Term)
|
target_link_libraries(bshell FX::Runtime FX::Collections FX::Term)
|
||||||
target_compile_definitions(bshell PUBLIC
|
target_compile_definitions(bshell PUBLIC
|
||||||
BSHELL_VERSION="${bshell_version}")
|
BSHELL_VERSION="${bshell_version}"
|
||||||
|
BSHELL_INTERACTIVE=${bshell_interactive})
|
||||||
|
|||||||
Reference in New Issue
Block a user