refactor(cmake): reorganize gRPC service and test harness integration
- Moved the gRPC test harness proto and services to `yaze_test_support` to avoid circular dependencies and improve modularity. - Updated the core library CMake configuration to reflect the new structure, ensuring proper inclusion of ROM service and canvas automation. - Enhanced the build messages to clarify the status of gRPC services and test harness integration. Benefits: - Streamlines the build process by clearly separating core and test functionalities. - Improves maintainability and clarity in the CMake configuration for gRPC services.
This commit is contained in:
@@ -122,27 +122,15 @@ if(YAZE_WITH_GRPC)
|
||||
${CMAKE_SOURCE_DIR}/third_party/json/include)
|
||||
target_compile_definitions(yaze_app_core_lib PRIVATE YAZE_WITH_JSON)
|
||||
|
||||
# Add proto definitions for test harness, ROM service, and canvas automation
|
||||
target_add_protobuf(yaze_app_core_lib
|
||||
${PROJECT_SOURCE_DIR}/src/protos/imgui_test_harness.proto)
|
||||
# Add proto definitions for ROM service and canvas automation
|
||||
# NOTE: Test harness proto moved to test.cmake with yaze_test_support
|
||||
target_add_protobuf(yaze_app_core_lib
|
||||
${PROJECT_SOURCE_DIR}/src/protos/rom_service.proto)
|
||||
target_add_protobuf(yaze_app_core_lib
|
||||
${PROJECT_SOURCE_DIR}/src/protos/canvas_automation.proto)
|
||||
|
||||
# Add service and testing implementation (now in app/service/ and app/test/)
|
||||
# Add unified gRPC server (non-test services only)
|
||||
target_sources(yaze_app_core_lib PRIVATE
|
||||
${CMAKE_SOURCE_DIR}/src/app/service/imgui_test_harness_service.cc
|
||||
${CMAKE_SOURCE_DIR}/src/app/service/imgui_test_harness_service.h
|
||||
${CMAKE_SOURCE_DIR}/src/app/service/screenshot_utils.cc
|
||||
${CMAKE_SOURCE_DIR}/src/app/service/screenshot_utils.h
|
||||
${CMAKE_SOURCE_DIR}/src/app/service/widget_discovery_service.cc
|
||||
${CMAKE_SOURCE_DIR}/src/app/service/widget_discovery_service.h
|
||||
${CMAKE_SOURCE_DIR}/src/app/test/test_recorder.cc
|
||||
${CMAKE_SOURCE_DIR}/src/app/test/test_recorder.h
|
||||
${CMAKE_SOURCE_DIR}/src/app/test/test_script_parser.cc
|
||||
${CMAKE_SOURCE_DIR}/src/app/test/test_script_parser.h
|
||||
# Add unified gRPC server
|
||||
${CMAKE_SOURCE_DIR}/src/app/service/unified_grpc_server.cc
|
||||
${CMAKE_SOURCE_DIR}/src/app/service/unified_grpc_server.h
|
||||
)
|
||||
@@ -160,7 +148,8 @@ if(YAZE_WITH_GRPC)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
message(STATUS " - gRPC test harness + ROM service enabled")
|
||||
message(STATUS " - gRPC ROM service + canvas automation enabled")
|
||||
message(STATUS " - gRPC test harness moved to yaze_test_support (avoid circular deps)")
|
||||
endif()
|
||||
|
||||
# Platform-specific libraries
|
||||
|
||||
@@ -15,6 +15,17 @@ set(YAZE_TEST_SOURCES
|
||||
app/test/z3ed_test_suite.cc
|
||||
)
|
||||
|
||||
# Add gRPC test harness services if enabled (depend on TestManager)
|
||||
if(YAZE_WITH_GRPC)
|
||||
list(APPEND YAZE_TEST_SOURCES
|
||||
app/service/imgui_test_harness_service.cc
|
||||
app/service/screenshot_utils.cc
|
||||
app/service/widget_discovery_service.cc
|
||||
app/test/test_recorder.cc
|
||||
app/test/test_script_parser.cc
|
||||
)
|
||||
endif()
|
||||
|
||||
add_library(yaze_test_support STATIC ${YAZE_TEST_SOURCES})
|
||||
|
||||
target_precompile_headers(yaze_test_support PRIVATE
|
||||
@@ -30,7 +41,7 @@ target_include_directories(yaze_test_support PUBLIC
|
||||
|
||||
target_link_libraries(yaze_test_support PUBLIC
|
||||
yaze_editor
|
||||
yaze_core_lib
|
||||
yaze_app_core_lib # Changed from yaze_core_lib - app layer needs app core
|
||||
yaze_gui
|
||||
yaze_zelda3
|
||||
yaze_gfx
|
||||
@@ -38,6 +49,24 @@ target_link_libraries(yaze_test_support PUBLIC
|
||||
yaze_common
|
||||
)
|
||||
|
||||
# Add gRPC dependencies if test harness is enabled
|
||||
if(YAZE_WITH_GRPC)
|
||||
target_include_directories(yaze_test_support PRIVATE
|
||||
${CMAKE_SOURCE_DIR}/third_party/json/include)
|
||||
target_compile_definitions(yaze_test_support PRIVATE YAZE_WITH_JSON)
|
||||
|
||||
# Add test harness proto definition
|
||||
target_add_protobuf(yaze_test_support
|
||||
${PROJECT_SOURCE_DIR}/src/protos/imgui_test_harness.proto)
|
||||
|
||||
target_link_libraries(yaze_test_support PUBLIC
|
||||
grpc++
|
||||
grpc++_reflection
|
||||
)
|
||||
|
||||
message(STATUS " - gRPC test harness service enabled in yaze_test_support")
|
||||
endif()
|
||||
|
||||
# Link agent library if available (for z3ed test suites)
|
||||
# yaze_agent contains all the CLI service code (tile16_proposal_generator, gui_automation_client, etc.)
|
||||
if(TARGET yaze_agent)
|
||||
|
||||
Reference in New Issue
Block a user