backend-infra-engineer: Post v0.3.9-hotfix7 snapshot (build cleanup)

This commit is contained in:
scawful
2025-12-22 00:20:49 +00:00
parent 2934c82b75
commit 5c4cd57ff8
1259 changed files with 239160 additions and 43801 deletions

View File

@@ -2,6 +2,8 @@
# Yaze Net Library
# ==============================================================================
# This library contains networking and collaboration functionality:
# - Network abstraction layer (HTTP/WebSocket interfaces)
# - Platform-specific implementations (native/WASM)
# - ROM version management
# - Proposal approval system
# - Collaboration utilities
@@ -9,13 +11,37 @@
# Dependencies: yaze_util, absl
# ==============================================================================
# Base network sources (always included)
set(
YAZE_NET_SRC
YAZE_NET_BASE_SRC
app/net/rom_version_manager.cc
app/net/websocket_client.cc
app/net/collaboration_service.cc
app/net/network_factory.cc
)
# Platform-specific network implementation
if(EMSCRIPTEN)
# WASM/Emscripten implementation
set(
YAZE_NET_PLATFORM_SRC
app/net/wasm/emscripten_http_client.cc
app/net/wasm/emscripten_websocket.cc
)
message(STATUS " - Using Emscripten network implementation (Fetch API & WebSocket)")
else()
# Native implementation
set(
YAZE_NET_PLATFORM_SRC
app/net/native/httplib_client.cc
app/net/native/httplib_websocket.cc
)
message(STATUS " - Using native network implementation (cpp-httplib)")
endif()
# Combine all sources
set(YAZE_NET_SRC ${YAZE_NET_BASE_SRC} ${YAZE_NET_PLATFORM_SRC})
if(YAZE_WITH_GRPC)
# Add ROM service implementation (disabled - proto field mismatch)
# list(APPEND YAZE_NET_SRC app/net/rom_service_impl.cc)
@@ -43,6 +69,20 @@ target_link_libraries(yaze_net PUBLIC
${YAZE_SDL2_TARGETS}
)
# Add Emscripten-specific flags for WASM builds
if(EMSCRIPTEN)
# Enable Fetch API for HTTP requests
target_compile_options(yaze_net PUBLIC "-sFETCH=1")
target_link_options(yaze_net PUBLIC "-sFETCH=1")
# WebSocket support requires linking websocket.js library
# The <emscripten/websocket.h> header provides the API, but the
# implementation is in the websocket.js library
target_link_libraries(yaze_net PUBLIC websocket.js)
message(STATUS " - Emscripten Fetch API and WebSocket enabled")
endif()
# Add JSON and httplib support if enabled
if(YAZE_WITH_JSON)
# Link nlohmann_json which provides the include directories automatically
@@ -90,12 +130,6 @@ if(YAZE_WITH_JSON)
endif()
endif()
# Add gRPC support for ROM service
if(YAZE_WITH_GRPC)
target_link_libraries(yaze_net PUBLIC yaze_grpc_support)
message(STATUS " - gRPC ROM service enabled")
endif()
set_target_properties(yaze_net PROPERTIES
POSITION_INDEPENDENT_CODE ON
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"