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:
@@ -76,6 +76,17 @@ else()
|
||||
message(STATUS "✓ All features enabled: JSON, gRPC, AI Agent")
|
||||
endif()
|
||||
|
||||
# Define preprocessor macros for feature flags (so #ifdef works in source code)
|
||||
if(YAZE_WITH_GRPC)
|
||||
add_compile_definitions(YAZE_WITH_GRPC)
|
||||
endif()
|
||||
if(YAZE_WITH_JSON)
|
||||
add_compile_definitions(YAZE_WITH_JSON)
|
||||
endif()
|
||||
if(Z3ED_AI)
|
||||
add_compile_definitions(Z3ED_AI)
|
||||
endif()
|
||||
|
||||
option(YAZE_SUPPRESS_WARNINGS "Suppress compiler warnings (use -v preset suffix for verbose)" ON)
|
||||
set(YAZE_TEST_ROM_PATH "${CMAKE_BINARY_DIR}/bin/zelda3.sfc" CACHE STRING "Path to test ROM file")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user