chore: consolidate gRPC and protobuf linking into a dedicated support library

- Introduced a new `yaze_grpc_support` library to centralize all gRPC and protobuf usage, addressing Windows linker errors and improving build stability.
- Updated CMake configurations across various components to link against the new support library instead of individual protobuf targets, simplifying the linking process.
- Removed legacy whole-archive linking logic, ensuring a cleaner and more maintainable build setup.

Benefits:
- Reduces complexity in CMake files and enhances compatibility across platforms.
- Prevents potential linker errors by consolidating gRPC and protobuf dependencies into a single library.
This commit is contained in:
scawful
2025-10-18 15:58:58 -04:00
parent 8e86c1bbdf
commit 6db7ba4782
15 changed files with 152 additions and 170 deletions

View File

@@ -95,16 +95,7 @@ else()
endif()
endif()
# Filter WHOLEARCHIVE targets to only include libraries (not executables like protoc)
set(YAZE_PROTOBUF_WHOLEARCHIVE_TARGETS)
foreach(_proto_target IN LISTS YAZE_PROTOBUF_TARGETS)
if(TARGET ${_proto_target})
get_target_property(_target_type ${_proto_target} TYPE)
if(_target_type MATCHES ".*_LIBRARY")
list(APPEND YAZE_PROTOBUF_WHOLEARCHIVE_TARGETS ${_proto_target})
endif()
endif()
endforeach()
# WHOLEARCHIVE logic removed - protobuf linking now handled by yaze_grpc_support library
if(YAZE_PROTOBUF_TARGETS)
list(GET YAZE_PROTOBUF_TARGETS 0 YAZE_PROTOBUF_TARGET)