Over the past couple of commits, the build process now automates the dependenices you'd normally compile from source. This commit is focused on laying the foundation for scriptable in-game commands using Lua. - sol2 and lua5.4 are the new project dependencies. - Created a new 'LuaProcessor' class to manage a Lua state and eecute scripts. - The 'CommandProcessor' now contains a 'LuaProcessor' instance. - Replaced the hardcoded c++ 'ls' command with a system that executes a '/bin/ls.lua' script from the Virtual File System. - Implemented C++ -> Lua bindings for the 'vfs_node' struct, allowing Lua scripts to inspect the VFS and perform actions (i.e, list files).
14 lines
282 B
CMake
14 lines
282 B
CMake
find_package(Lua 5.4 REQUIRED)
|
|
|
|
file(GLOB_RECURSE BETTOLA_SOURCES "src/*.cpp")
|
|
|
|
add_library(bettola
|
|
${BETTOLA_SOURCES}
|
|
)
|
|
|
|
target_link_libraries(bettola PUBLIC ${LUA_LIBRARIES} sol2)
|
|
|
|
target_include_directories(bettola PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/src
|
|
${LUA_INCLUDE_DIR})
|
|
|