chore: update configuration files and enhance dependency management

- Added new entries to `.pre-commit-config.yaml`, `cmake-format.yaml`, and `.github/dependabot.yml` to improve code quality checks and dependency updates.
- Enhanced GitHub Actions workflows by adding new steps for testing and build retention.
- Introduced support for the nlohmann_json library in CMake, allowing for conditional inclusion based on the `YAZE_ENABLE_JSON` option.
- Updated CMake configurations to streamline SDL2 and gRPC integration, ensuring proper linking and target management.

Benefits:
- Improves code quality and consistency through automated checks and formatting.
- Enhances dependency management and build reliability across platforms.
- Provides flexibility for users to enable optional features, improving overall functionality.
This commit is contained in:
scawful
2025-10-31 20:20:31 -04:00
parent d07c0abae8
commit ef07dc0012
40 changed files with 465 additions and 332 deletions

View File

@@ -50,10 +50,9 @@ if(APPLE)
${CMAKE_SOURCE_DIR}/src/lib
${CMAKE_SOURCE_DIR}/src/lib/imgui
${CMAKE_SOURCE_DIR}/incl
${SDL2_INCLUDE_DIR}
${PROJECT_BINARY_DIR}
)
target_link_libraries(yaze_app_objcxx PUBLIC ${ABSL_TARGETS} yaze_util)
target_link_libraries(yaze_app_objcxx PUBLIC ${ABSL_TARGETS} yaze_util ${YAZE_SDL2_TARGETS})
target_compile_definitions(yaze_app_objcxx PUBLIC MACOS)
find_library(COCOA_LIBRARY Cocoa)
@@ -91,7 +90,7 @@ target_link_libraries(yaze_app_core_lib PUBLIC
yaze_common
ImGui
${ABSL_TARGETS}
${SDL_TARGETS}
${YAZE_SDL2_TARGETS}
${CMAKE_DL_LIBS}
)

View File

@@ -57,7 +57,7 @@ set(
app/editor/ui/workspace_manager.cc
)
if(YAZE_WITH_GRPC)
if(YAZE_ENABLE_GRPC)
list(APPEND YAZE_APP_EDITOR_SRC
app/editor/agent/agent_editor.cc
app/editor/agent/agent_chat_widget.cc

View File

@@ -7,6 +7,7 @@
#include "app/gui/core/icons.h"
#include "app/gui/core/theme_manager.h"
#include "imgui/imgui.h"
#include "util/log.h"
namespace yaze {
namespace editor {

View File

@@ -31,7 +31,7 @@ target_link_libraries(yaze_emulator PUBLIC
yaze_common
yaze_app_core_lib
${ABSL_TARGETS}
${SDL_TARGETS}
${YAZE_SDL2_TARGETS}
)
set_target_properties(yaze_emulator PROPERTIES

View File

@@ -21,13 +21,11 @@ macro(configure_gfx_library name)
${CMAKE_SOURCE_DIR}/src
${CMAKE_SOURCE_DIR}/src/lib
${CMAKE_SOURCE_DIR}/incl
${SDL2_INCLUDE_DIR}
${PROJECT_BINARY_DIR}
)
target_link_libraries(${name} PUBLIC
yaze_util
yaze_common
${ABSL_TARGETS}
)
set_target_properties(${name} PROPERTIES
POSITION_INDEPENDENT_CODE ON
@@ -102,13 +100,15 @@ set(GFX_DEBUG_SRC
# Layer 1: Foundation types (no dependencies)
add_library(yaze_gfx_types STATIC ${GFX_TYPES_SRC})
configure_gfx_library(yaze_gfx_types)
# Debug: message(STATUS "YAZE_SDL2_TARGETS for gfx_types: '${YAZE_SDL2_TARGETS}'")
target_link_libraries(yaze_gfx_types PUBLIC ${YAZE_SDL2_TARGETS})
# Layer 2: Backend (depends on types)
add_library(yaze_gfx_backend STATIC ${GFX_BACKEND_SRC})
configure_gfx_library(yaze_gfx_backend)
target_link_libraries(yaze_gfx_backend PUBLIC
yaze_gfx_types
${SDL_TARGETS}
${YAZE_SDL2_TARGETS}
)
# Layer 3a: Resource management (depends on backend)
@@ -122,6 +122,7 @@ configure_gfx_library(yaze_gfx_render)
target_link_libraries(yaze_gfx_render PUBLIC
yaze_gfx_types
yaze_gfx_backend
${YAZE_SDL2_TARGETS}
)
# Layer 3c: Debug tools (depends on types only at this level)
@@ -131,6 +132,7 @@ target_link_libraries(yaze_gfx_debug PUBLIC
yaze_gfx_types
yaze_gfx_resource
ImGui
${YAZE_SDL2_TARGETS}
)
# Layer 4: Core bitmap (depends on render, debug)

View File

@@ -134,7 +134,7 @@ target_link_libraries(yaze_gui INTERFACE
yaze_common
yaze_net
ImGui
${SDL_TARGETS}
${YAZE_SDL2_TARGETS}
)
message(STATUS "✓ yaze_gui library refactored and configured")

View File

@@ -31,7 +31,8 @@ target_include_directories(yaze_net PUBLIC
${CMAKE_SOURCE_DIR}/src
${CMAKE_SOURCE_DIR}/src/lib
${CMAKE_SOURCE_DIR}/src/lib/imgui
${SDL2_INCLUDE_DIR}
${CMAKE_SOURCE_DIR}/third_party/json/include
${CMAKE_SOURCE_DIR}/third_party/httplib
${PROJECT_BINARY_DIR}
)
@@ -39,13 +40,14 @@ target_link_libraries(yaze_net PUBLIC
yaze_util
yaze_common
${ABSL_TARGETS}
${YAZE_SDL2_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)
# 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_compile_definitions(yaze_net PUBLIC YAZE_WITH_JSON)
# Add threading support (cross-platform)

View File

@@ -54,7 +54,7 @@ target_link_libraries(yaze_grpc_support PUBLIC
yaze_gui
yaze_emulator
${ABSL_TARGETS}
${SDL_TARGETS}
${YAZE_SDL2_TARGETS}
)
# Add JSON support