add Lua sandbox with timer system (milestones 1-5 complete)
This commit is contained in:
54
sandbox-test/CMakeLists.txt
Normal file
54
sandbox-test/CMakeLists.txt
Normal file
@@ -0,0 +1,54 @@
|
||||
cmake_minimum_required(VERSION 3.22.1)
|
||||
project(sandbox-test)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 23)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
# Find dependencies via vcpkg
|
||||
find_package(Lua REQUIRED)
|
||||
find_package(nlohmann_json CONFIG REQUIRED)
|
||||
|
||||
# Sandbox library (the code being tested)
|
||||
add_library(mosis-sandbox STATIC
|
||||
../src/main/cpp/sandbox/lua_sandbox.cpp
|
||||
../src/main/cpp/sandbox/permission_gate.cpp
|
||||
../src/main/cpp/sandbox/audit_log.cpp
|
||||
../src/main/cpp/sandbox/rate_limiter.cpp
|
||||
../src/main/cpp/sandbox/path_sandbox.cpp
|
||||
../src/main/cpp/sandbox/timer_manager.cpp
|
||||
)
|
||||
target_include_directories(mosis-sandbox PUBLIC
|
||||
../src/main/cpp/sandbox
|
||||
${LUA_INCLUDE_DIR}
|
||||
)
|
||||
target_link_libraries(mosis-sandbox PUBLIC
|
||||
${LUA_LIBRARIES}
|
||||
)
|
||||
|
||||
# Test executable
|
||||
add_executable(sandbox-test
|
||||
src/main.cpp
|
||||
src/test_harness.cpp
|
||||
)
|
||||
|
||||
target_include_directories(sandbox-test PRIVATE
|
||||
src
|
||||
../src/main/cpp/sandbox
|
||||
)
|
||||
|
||||
target_link_libraries(sandbox-test PRIVATE
|
||||
mosis-sandbox
|
||||
nlohmann_json::nlohmann_json
|
||||
)
|
||||
|
||||
# Copy test scripts to build directory
|
||||
add_custom_command(TARGET sandbox-test POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/scripts
|
||||
$<TARGET_FILE_DIR:sandbox-test>/scripts
|
||||
)
|
||||
|
||||
# Windows-specific
|
||||
if(WIN32)
|
||||
target_compile_definitions(sandbox-test PRIVATE _CRT_SECURE_NO_WARNINGS)
|
||||
endif()
|
||||
Reference in New Issue
Block a user