refactor: reorganize submodule structure and enhance CMake configuration
- Moved all third-party libraries (SDL, ImGui, Asar, etc.) from `src/lib/` and `third_party/` to a new `ext/` directory for better organization and clarity in dependency management. - Updated CMake configuration to reflect the new paths, ensuring all targets and includes point to the `ext/` directory. - Enhanced CMake presets to support new build options for AI and gRPC features, improving modularity and build flexibility. - Added new feature flags for agent UI and remote automation, allowing for more granular control over build configurations. - Updated documentation to reflect changes in the project structure and build options, ensuring clarity for contributors and users.
This commit is contained in:
@@ -47,8 +47,8 @@ if(APPLE)
|
||||
target_include_directories(yaze_app_objcxx PUBLIC
|
||||
${CMAKE_SOURCE_DIR}/src
|
||||
${CMAKE_SOURCE_DIR}/src/app
|
||||
${CMAKE_SOURCE_DIR}/src/lib
|
||||
${CMAKE_SOURCE_DIR}/src/lib/imgui
|
||||
${CMAKE_SOURCE_DIR}/ext
|
||||
${CMAKE_SOURCE_DIR}/ext/imgui
|
||||
${CMAKE_SOURCE_DIR}/incl
|
||||
${PROJECT_BINARY_DIR}
|
||||
)
|
||||
@@ -75,8 +75,8 @@ target_precompile_headers(yaze_app_core_lib PRIVATE
|
||||
target_include_directories(yaze_app_core_lib PUBLIC
|
||||
${CMAKE_SOURCE_DIR}/src
|
||||
${CMAKE_SOURCE_DIR}/src/app
|
||||
${CMAKE_SOURCE_DIR}/src/lib
|
||||
${CMAKE_SOURCE_DIR}/src/lib/imgui
|
||||
${CMAKE_SOURCE_DIR}/ext
|
||||
${CMAKE_SOURCE_DIR}/ext/imgui
|
||||
${CMAKE_SOURCE_DIR}/incl
|
||||
${SDL2_INCLUDE_DIR}
|
||||
${PROJECT_BINARY_DIR}
|
||||
@@ -96,15 +96,15 @@ target_link_libraries(yaze_app_core_lib PUBLIC
|
||||
|
||||
# Link nativefiledialog-extended for Windows/Linux file dialogs
|
||||
if(WIN32 OR (UNIX AND NOT APPLE))
|
||||
add_subdirectory(${CMAKE_SOURCE_DIR}/src/lib/nativefiledialog-extended ${CMAKE_BINARY_DIR}/nfd EXCLUDE_FROM_ALL)
|
||||
add_subdirectory(${CMAKE_SOURCE_DIR}/ext/nativefiledialog-extended ${CMAKE_BINARY_DIR}/nfd EXCLUDE_FROM_ALL)
|
||||
target_link_libraries(yaze_app_core_lib PUBLIC nfd)
|
||||
target_include_directories(yaze_app_core_lib PUBLIC ${CMAKE_SOURCE_DIR}/src/lib/nativefiledialog-extended/src/include)
|
||||
target_include_directories(yaze_app_core_lib PUBLIC ${CMAKE_SOURCE_DIR}/ext/nativefiledialog-extended/src/include)
|
||||
endif()
|
||||
|
||||
# gRPC Services (Optional)
|
||||
if(YAZE_WITH_GRPC)
|
||||
target_include_directories(yaze_app_core_lib PRIVATE
|
||||
${CMAKE_SOURCE_DIR}/third_party/json/include)
|
||||
${CMAKE_SOURCE_DIR}/ext/json/include)
|
||||
target_compile_definitions(yaze_app_core_lib PRIVATE YAZE_WITH_JSON)
|
||||
|
||||
# Link to consolidated gRPC support library
|
||||
|
||||
@@ -57,7 +57,7 @@ set(
|
||||
app/editor/ui/workspace_manager.cc
|
||||
)
|
||||
|
||||
if(YAZE_ENABLE_GRPC)
|
||||
if(YAZE_BUILD_AGENT_UI)
|
||||
list(APPEND YAZE_APP_EDITOR_SRC
|
||||
app/editor/agent/agent_editor.cc
|
||||
app/editor/agent/agent_chat_widget.cc
|
||||
@@ -95,9 +95,9 @@ target_precompile_headers(yaze_editor PRIVATE
|
||||
|
||||
target_include_directories(yaze_editor PUBLIC
|
||||
${CMAKE_SOURCE_DIR}/src
|
||||
${CMAKE_SOURCE_DIR}/src/lib
|
||||
${CMAKE_SOURCE_DIR}/src/lib/imgui
|
||||
${CMAKE_SOURCE_DIR}/src/lib/imgui_test_engine
|
||||
${CMAKE_SOURCE_DIR}/ext
|
||||
${CMAKE_SOURCE_DIR}/ext/imgui
|
||||
${CMAKE_SOURCE_DIR}/ext/imgui_test_engine
|
||||
${CMAKE_SOURCE_DIR}/incl
|
||||
${SDL2_INCLUDE_DIR}
|
||||
${PROJECT_BINARY_DIR}
|
||||
@@ -114,11 +114,13 @@ target_link_libraries(yaze_editor PUBLIC
|
||||
ImGui
|
||||
)
|
||||
|
||||
# Link agent library for AI features (always available when not in minimal build)
|
||||
if(NOT YAZE_MINIMAL_BUILD)
|
||||
# Link agent runtime only when agent UI panels are enabled
|
||||
if(YAZE_BUILD_AGENT_UI AND NOT YAZE_MINIMAL_BUILD)
|
||||
if(TARGET yaze_agent)
|
||||
target_link_libraries(yaze_editor PUBLIC yaze_agent)
|
||||
message(STATUS "✓ yaze_editor linked to yaze_agent")
|
||||
message(STATUS "✓ yaze_editor linked to yaze_agent (UI panels)")
|
||||
else()
|
||||
message(WARNING "Agent UI requested but yaze_agent target not found")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@@ -126,7 +128,7 @@ endif()
|
||||
|
||||
if(YAZE_WITH_JSON)
|
||||
target_include_directories(yaze_editor PUBLIC
|
||||
${CMAKE_SOURCE_DIR}/third_party/json/include)
|
||||
${CMAKE_SOURCE_DIR}/ext/json/include)
|
||||
|
||||
if(TARGET nlohmann_json::nlohmann_json)
|
||||
target_link_libraries(yaze_editor PUBLIC nlohmann_json::nlohmann_json)
|
||||
|
||||
@@ -29,10 +29,10 @@ target_precompile_headers(yaze_net PRIVATE
|
||||
|
||||
target_include_directories(yaze_net PUBLIC
|
||||
${CMAKE_SOURCE_DIR}/src
|
||||
${CMAKE_SOURCE_DIR}/src/lib
|
||||
${CMAKE_SOURCE_DIR}/src/lib/imgui
|
||||
${CMAKE_SOURCE_DIR}/third_party/json/include
|
||||
${CMAKE_SOURCE_DIR}/third_party/httplib
|
||||
${CMAKE_SOURCE_DIR}/ext
|
||||
${CMAKE_SOURCE_DIR}/ext/imgui
|
||||
${CMAKE_SOURCE_DIR}/ext/json/include
|
||||
${CMAKE_SOURCE_DIR}/ext/httplib
|
||||
${PROJECT_BINARY_DIR}
|
||||
)
|
||||
|
||||
@@ -47,7 +47,7 @@ target_link_libraries(yaze_net PUBLIC
|
||||
if(YAZE_WITH_JSON)
|
||||
# Link nlohmann_json which provides the include directories automatically
|
||||
target_link_libraries(yaze_net PUBLIC nlohmann_json::nlohmann_json)
|
||||
target_include_directories(yaze_net PUBLIC ${CMAKE_SOURCE_DIR}/third_party/httplib)
|
||||
target_include_directories(yaze_net PUBLIC ${CMAKE_SOURCE_DIR}/ext/httplib)
|
||||
target_compile_definitions(yaze_net PUBLIC YAZE_WITH_JSON)
|
||||
|
||||
# Add threading support (cross-platform)
|
||||
|
||||
@@ -21,10 +21,6 @@ set(
|
||||
# Test infrastructure
|
||||
app/test/test_recorder.cc
|
||||
app/test/test_script_parser.cc
|
||||
|
||||
# CLI agent gRPC client code (only files that actually exist)
|
||||
cli/service/planning/tile16_proposal_generator.cc
|
||||
cli/service/gui/gui_automation_client.cc
|
||||
)
|
||||
|
||||
add_library(yaze_grpc_support STATIC ${YAZE_GRPC_SOURCES})
|
||||
@@ -36,9 +32,9 @@ target_precompile_headers(yaze_grpc_support PRIVATE
|
||||
target_include_directories(yaze_grpc_support PUBLIC
|
||||
${CMAKE_SOURCE_DIR}/src
|
||||
${CMAKE_SOURCE_DIR}/src/app
|
||||
${CMAKE_SOURCE_DIR}/src/lib
|
||||
${CMAKE_SOURCE_DIR}/src/lib/imgui
|
||||
${CMAKE_SOURCE_DIR}/src/lib/imgui_test_engine
|
||||
${CMAKE_SOURCE_DIR}/ext
|
||||
${CMAKE_SOURCE_DIR}/ext/imgui
|
||||
${CMAKE_SOURCE_DIR}/ext/imgui_test_engine
|
||||
${CMAKE_SOURCE_DIR}/incl
|
||||
${SDL2_INCLUDE_DIR}
|
||||
${PROJECT_BINARY_DIR}
|
||||
@@ -60,7 +56,7 @@ target_link_libraries(yaze_grpc_support PUBLIC
|
||||
# Add JSON support
|
||||
if(YAZE_WITH_JSON)
|
||||
target_include_directories(yaze_grpc_support PUBLIC
|
||||
${CMAKE_SOURCE_DIR}/third_party/json/include)
|
||||
${CMAKE_SOURCE_DIR}/ext/json/include)
|
||||
target_compile_definitions(yaze_grpc_support PUBLIC YAZE_WITH_JSON)
|
||||
endif()
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ target_precompile_headers(yaze_test_support PRIVATE
|
||||
target_include_directories(yaze_test_support PUBLIC
|
||||
${CMAKE_SOURCE_DIR}/src
|
||||
${CMAKE_SOURCE_DIR}/incl
|
||||
${CMAKE_SOURCE_DIR}/src/lib
|
||||
${CMAKE_SOURCE_DIR}/ext
|
||||
${PROJECT_BINARY_DIR}
|
||||
)
|
||||
|
||||
@@ -43,7 +43,7 @@ target_link_libraries(yaze_test_support PUBLIC
|
||||
# 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)
|
||||
${CMAKE_SOURCE_DIR}/ext/json/include)
|
||||
target_compile_definitions(yaze_test_support PRIVATE YAZE_WITH_JSON)
|
||||
|
||||
# Link to consolidated gRPC support library
|
||||
|
||||
Reference in New Issue
Block a user