- Added `UnifiedGRPCServer` class to host both ImGuiTestHarness and ROM service, allowing simultaneous access to GUI automation and ROM manipulation. - Implemented necessary header and source files for the unified server, including initialization, start, and shutdown functionalities. - Updated CMake configurations to include new source files and link required gRPC libraries for the unified server. - Enhanced existing services with gRPC support, improving overall system capabilities and enabling real-time collaboration. - Added integration tests for AI-controlled tile placement, validating command parsing and execution via gRPC.
88 lines
2.5 KiB
CMake
88 lines
2.5 KiB
CMake
# ==============================================================================
|
|
# Yaze Net Library
|
|
# ==============================================================================
|
|
# This library contains networking and collaboration functionality:
|
|
# - ROM version management
|
|
# - Proposal approval system
|
|
# - Collaboration utilities
|
|
#
|
|
# Dependencies: yaze_util, absl
|
|
# ==============================================================================
|
|
|
|
set(
|
|
YAZE_NET_SRC
|
|
app/net/rom_version_manager.cc
|
|
app/net/websocket_client.cc
|
|
app/net/collaboration_service.cc
|
|
)
|
|
|
|
if(YAZE_WITH_GRPC)
|
|
# Add ROM service implementation
|
|
list(APPEND YAZE_NET_SRC app/net/rom_service_impl.cc)
|
|
endif()
|
|
|
|
add_library(yaze_net STATIC ${YAZE_NET_SRC})
|
|
|
|
target_include_directories(yaze_net PUBLIC
|
|
${CMAKE_SOURCE_DIR}/src
|
|
${CMAKE_SOURCE_DIR}/src/lib
|
|
${CMAKE_SOURCE_DIR}/src/lib/imgui
|
|
${SDL2_INCLUDE_DIR}
|
|
${PROJECT_BINARY_DIR}
|
|
)
|
|
|
|
target_link_libraries(yaze_net PUBLIC
|
|
yaze_util
|
|
yaze_common
|
|
${ABSL_TARGETS}
|
|
)
|
|
|
|
# Add JSON and httplib support if enabled
|
|
if(YAZE_WITH_JSON)
|
|
target_include_directories(yaze_net PUBLIC
|
|
${CMAKE_SOURCE_DIR}/third_party/json/include
|
|
${CMAKE_SOURCE_DIR}/third_party/httplib)
|
|
target_compile_definitions(yaze_net PUBLIC YAZE_WITH_JSON)
|
|
|
|
# Add threading support (cross-platform)
|
|
find_package(Threads REQUIRED)
|
|
target_link_libraries(yaze_net PUBLIC Threads::Threads)
|
|
|
|
# Add OpenSSL for HTTPS/WSS support (optional but recommended)
|
|
find_package(OpenSSL QUIET)
|
|
if(OpenSSL_FOUND)
|
|
target_link_libraries(yaze_net PUBLIC OpenSSL::SSL OpenSSL::Crypto)
|
|
target_compile_definitions(yaze_net PUBLIC CPPHTTPLIB_OPENSSL_SUPPORT)
|
|
message(STATUS " - WebSocket with SSL/TLS support enabled")
|
|
else()
|
|
message(STATUS " - WebSocket without SSL/TLS (OpenSSL not found)")
|
|
endif()
|
|
|
|
# Windows-specific socket library
|
|
if(WIN32)
|
|
target_link_libraries(yaze_net PUBLIC ws2_32)
|
|
message(STATUS " - Windows socket support (ws2_32) linked")
|
|
endif()
|
|
endif()
|
|
|
|
# Add gRPC support for ROM service
|
|
if(YAZE_WITH_GRPC)
|
|
target_add_protobuf(yaze_net ${CMAKE_SOURCE_DIR}/protos/rom_service.proto)
|
|
|
|
target_link_libraries(yaze_net PUBLIC
|
|
grpc++
|
|
grpc++_reflection
|
|
libprotobuf
|
|
)
|
|
|
|
message(STATUS " - gRPC ROM service enabled")
|
|
endif()
|
|
|
|
set_target_properties(yaze_net PROPERTIES
|
|
POSITION_INDEPENDENT_CODE ON
|
|
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
|
|
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
|
|
)
|
|
|
|
message(STATUS "✓ yaze_net library configured")
|