feat(cmake): add feature flags for gRPC and JSON in CMake configuration
- Introduced preprocessor macros for feature flags in CMake, allowing conditional compilation based on the presence of gRPC and JSON features. - Updated the agent source file list to include gRPC-dependent sources only when gRPC is enabled, enhancing modularity and maintainability. Benefits: - Improved flexibility in enabling/disabling features at compile time. - Streamlined source management for better organization of gRPC-related components.
This commit is contained in:
@@ -1,9 +1,7 @@
|
||||
set(YAZE_AGENT_SOURCES
|
||||
cli/service/agent/proposal_executor.cc
|
||||
cli/handlers/agent/todo_commands.cc
|
||||
cli/service/agent/agent_control_server.cc
|
||||
cli/service/agent/conversational_agent_service.cc
|
||||
cli/service/agent/emulator_service_impl.cc
|
||||
cli/service/agent/simple_chat_session.cc
|
||||
cli/service/agent/enhanced_tui.cc
|
||||
cli/service/agent/tool_dispatcher.cc
|
||||
@@ -53,6 +51,14 @@ set(YAZE_AGENT_SOURCES
|
||||
cli/service/rom/rom_sandbox_manager.cc
|
||||
)
|
||||
|
||||
# gRPC-dependent sources (only added when gRPC is enabled)
|
||||
if(YAZE_WITH_GRPC)
|
||||
list(APPEND YAZE_AGENT_SOURCES
|
||||
cli/service/agent/agent_control_server.cc
|
||||
cli/service/agent/emulator_service_impl.cc
|
||||
)
|
||||
endif()
|
||||
|
||||
if(YAZE_WITH_JSON)
|
||||
list(APPEND YAZE_AGENT_SOURCES cli/service/ai/gemini_ai_service.cc)
|
||||
endif()
|
||||
@@ -121,6 +127,9 @@ if(YAZE_WITH_GRPC)
|
||||
grpc++_reflection
|
||||
libprotobuf
|
||||
)
|
||||
|
||||
# Note: YAZE_WITH_GRPC is defined globally via add_compile_definitions in root CMakeLists.txt
|
||||
# This ensures #ifdef YAZE_WITH_GRPC works in all translation units
|
||||
message(STATUS "✓ gRPC GUI automation enabled for yaze_agent")
|
||||
endif()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user