extract shared mosis-core library from sandbox APIs
Create core/ directory with platform-agnostic sandbox components: - Timer manager, JSON API, Crypto API, Virtual FS - Lua sandbox, Permission gate, Audit log, Rate limiter - Platform abstraction interfaces (IAssetInterface, IFilesystemInterface) - Platform-agnostic logger with Android/Desktop implementations Update designer to link against mosis-core library instead of including sandbox sources directly. This is the foundation for unifying the Android service and desktop designer to share the same codebase. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -30,7 +30,18 @@ FetchContent_MakeAvailable(rmlui)
|
||||
# Get glad include directories explicitly
|
||||
get_target_property(GLAD_INCLUDE_DIRS glad::glad INTERFACE_INCLUDE_DIRECTORIES)
|
||||
|
||||
# Shared kernel library (platform-agnostic code from MosisService)
|
||||
#==============================================================================
|
||||
# Mosis Core Library (shared sandbox APIs)
|
||||
#==============================================================================
|
||||
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../core ${CMAKE_CURRENT_BINARY_DIR}/mosis-core)
|
||||
|
||||
# Point mosis-core to use the same Lua and JSON as designer
|
||||
target_include_directories(mosis-core PUBLIC ${LUA_INCLUDE_DIR})
|
||||
target_link_libraries(mosis-core PUBLIC ${LUA_LIBRARIES})
|
||||
|
||||
#==============================================================================
|
||||
# Mosis Kernel (RmlUi renderer - platform specific for now)
|
||||
#==============================================================================
|
||||
add_library(mosis-kernel STATIC
|
||||
../src/main/cpp/RmlUi_Renderer_GL3.cpp
|
||||
)
|
||||
@@ -55,15 +66,9 @@ target_compile_definitions(mosis-kernel PUBLIC
|
||||
RMLUI_GL3_CUSTOM_LOADER="glad_loader.h"
|
||||
)
|
||||
|
||||
# Sandbox sources (reuse from MosisService)
|
||||
set(SANDBOX_SOURCES
|
||||
../src/main/cpp/sandbox/timer_manager.cpp
|
||||
../src/main/cpp/sandbox/json_api.cpp
|
||||
../src/main/cpp/sandbox/crypto_api.cpp
|
||||
../src/main/cpp/sandbox/virtual_fs.cpp
|
||||
)
|
||||
|
||||
# Designer executable
|
||||
#==============================================================================
|
||||
# Designer Executable
|
||||
#==============================================================================
|
||||
add_executable(mosis-designer
|
||||
main.cpp
|
||||
src/desktop_platform.cpp
|
||||
@@ -79,8 +84,6 @@ add_executable(mosis-designer
|
||||
# Local backend with input recording hooks
|
||||
src/backend/RmlUi_Backend_GLFW_GL3.cpp
|
||||
src/backend/RmlUi_Platform_GLFW.cpp
|
||||
# Sandbox APIs
|
||||
${SANDBOX_SOURCES}
|
||||
)
|
||||
|
||||
target_include_directories(mosis-designer PRIVATE
|
||||
@@ -89,11 +92,14 @@ target_include_directories(mosis-designer PRIVATE
|
||||
src/backend
|
||||
../src/main/kernel/include
|
||||
../src/main/cpp
|
||||
../src/main/cpp/sandbox
|
||||
# Core library includes
|
||||
../core/include
|
||||
../core/include/mosis/sandbox
|
||||
)
|
||||
|
||||
target_link_libraries(mosis-designer PRIVATE
|
||||
mosis-kernel
|
||||
mosis-core
|
||||
glad::glad
|
||||
glfw
|
||||
freetype
|
||||
|
||||
Reference in New Issue
Block a user