Files
ReSkate/cmake/Dependencies.cmake
T
AyeZeeBB 6d542536e1 Plugins: sandboxed Luau plugins in mods, phase 1 (the host, and the base, console and storage APIs)
A mod with a reskate-plugin.json is a plugin: Luau scripts that run in their own VM, with only
the reskate API ReSkate registers for them. Luau 0.741 is vendored in External/luau (the VM and
compiler only: no native code generation, no loadstring, io or C modules).

- Limits: 64 MB of memory, 50 ms a call, 2 ms a tick on average (over it for 3 s stops it),
  more than 5 errors in 10 s stops it, 50 log lines a second. A plugin over a limit cannot catch
  it in a pcall and carry on.
- API: reskate.log, on (load, unload, tick, level_loaded, level_unloading), timers, the level,
  its own package's files and JSON, require inside the package; console.command and print
  ("console"); storage get, set, add and keys ("storage"), 1 MB in
  %LOCALAPPDATA%\ReSkate\Plugins\<mod>\storage.json.
- Found every 2 s among the mods mods.json leaves on: switching a mod, or changing a plugin's
  files, loads, unloads or reloads it without a restart. A package holding a program is refused.
- plugin list, commands, reload, off and on in the console. A plugin cannot take a name of
  ReSkate's own commands.
- Tests: DINGOSDK_BUILD_PLUGIN_TESTS, including plugins written to break the sandbox.
2026-10-19 11:55:27 -05:00

63 lines
3.9 KiB
CMake

if(WIN32)
add_library(dingosdk_imgui STATIC
"${PROJECT_SOURCE_DIR}/External/imgui/imgui.cpp"
"${PROJECT_SOURCE_DIR}/External/imgui/imgui_draw.cpp"
"${PROJECT_SOURCE_DIR}/External/imgui/imgui_tables.cpp"
"${PROJECT_SOURCE_DIR}/External/imgui/imgui_widgets.cpp"
"${PROJECT_SOURCE_DIR}/External/imgui/backends/imgui_impl_dx12.cpp"
"${PROJECT_SOURCE_DIR}/External/imgui/backends/imgui_impl_win32.cpp")
target_include_directories(dingosdk_imgui PUBLIC "${PROJECT_SOURCE_DIR}/External/imgui")
# The backend's own gamepad reads only XInput slot 0. The launcher feeds every pad
# itself (Launcher/gamepad_input.cpp), and the in-game menu does not use ImGui's gamepad keys.
target_compile_definitions(dingosdk_imgui PRIVATE WIN32_LEAN_AND_MEAN NOMINMAX UNICODE _UNICODE
IMGUI_IMPL_WIN32_DISABLE_GAMEPAD)
target_link_libraries(dingosdk_imgui PUBLIC d3d12 dxgi d3dcompiler dwmapi)
add_library(dingosdk_detours STATIC
External/detours/src/detours.cpp
External/detours/src/modules.cpp
External/detours/src/disasm.cpp
External/detours/src/image.cpp
External/detours/src/creatwth.cpp
External/detours/src/disolx86.cpp
External/detours/src/disolx64.cpp
External/detours/src/disolia64.cpp
External/detours/src/disolarm.cpp
External/detours/src/disolarm64.cpp)
target_include_directories(dingosdk_detours SYSTEM PUBLIC External/detours/src)
target_compile_definitions(dingosdk_detours PRIVATE WIN32_LEAN_AND_MEAN NOMINMAX)
set_target_properties(dingosdk_imgui dingosdk_detours PROPERTIES FOLDER "Dependencies")
endif()
enable_language(C)
add_library(dingosdk_miniz STATIC External/miniz/miniz.c)
target_include_directories(dingosdk_miniz SYSTEM PUBLIC External/miniz)
target_compile_definitions(dingosdk_miniz PUBLIC MINIZ_NO_ARCHIVE_WRITING_APIS MINIZ_NO_DEFLATE_APIS MINIZ_NO_ZLIB_APIS MINIZ_NO_STDIO MINIZ_NO_TIME)
set_target_properties(dingosdk_miniz PROPERTIES FOLDER "Dependencies")
add_library(dingosdk_lz4 STATIC External/lz4/lz4.c)
target_include_directories(dingosdk_lz4 SYSTEM PUBLIC External/lz4)
set_target_properties(dingosdk_lz4 PROPERTIES FOLDER "Dependencies")
file(GLOB zstd_sources CONFIGURE_DEPENDS External/zstd/lib/common/*.c
External/zstd/lib/compress/*.c External/zstd/lib/decompress/*.c)
add_library(dingosdk_zstd STATIC ${zstd_sources})
target_include_directories(dingosdk_zstd SYSTEM PUBLIC External/zstd/lib)
target_compile_definitions(dingosdk_zstd PRIVATE ZSTD_LEGACY_SUPPORT=0 ZSTD_DISABLE_ASM)
set_target_properties(dingosdk_zstd PROPERTIES FOLDER "Dependencies")
# Luau (External/luau): the VM and compiler plugins run on (Extension/Plugins). Only these five
# parts: no CodeGen (native code from scripts), no Analysis, no CLI or Require.
file(GLOB dingosdk_luau_sources CONFIGURE_DEPENDS External/luau/Common/src/*.cpp External/luau/Ast/src/*.cpp
External/luau/Bytecode/src/*.cpp External/luau/Compiler/src/*.cpp External/luau/VM/src/*.cpp)
add_library(dingosdk_luau STATIC ${dingosdk_luau_sources})
target_include_directories(dingosdk_luau SYSTEM PUBLIC External/luau/Common/include External/luau/Ast/include
External/luau/Bytecode/include External/luau/Compiler/include External/luau/VM/include)
target_include_directories(dingosdk_luau PRIVATE External/luau/VM/src External/luau/Bytecode/src)
target_compile_features(dingosdk_luau PRIVATE cxx_std_17)
if(MSVC)
target_compile_definitions(dingosdk_luau PRIVATE _CRT_SECURE_NO_WARNINGS)
endif()
set_target_properties(dingosdk_luau PROPERTIES FOLDER "Dependencies")
add_library(dingosdk_sqlite STATIC External/sqlite/sqlite3.c)
target_include_directories(dingosdk_sqlite SYSTEM PUBLIC External/sqlite)
target_compile_definitions(dingosdk_sqlite PRIVATE SQLITE_THREADSAFE=1 SQLITE_OMIT_LOAD_EXTENSION SQLITE_DQS=0 SQLITE_DEFAULT_MEMSTATUS=0)
set_target_properties(dingosdk_sqlite PROPERTIES FOLDER "Dependencies")