refactor(cmake): enhance Protobuf target handling for MSVC

- Introduced YAZE_PROTOBUF_WHOLEARCHIVE_TARGETS to streamline linking of Protobuf targets, excluding "lite" variants.
- Updated CMake configurations across various components (yaze, yaze_core_lib, yaze_editor, yaze_net, yaze_agent, z3ed) to utilize the new whole-archive targets for MSVC builds.
- Improved test suite linking to ensure all Protobuf symbols are included during the build process.

Benefits:
- Enhances compatibility and maintainability of Protobuf linking, leading to a more robust build configuration.
This commit is contained in:
scawful
2025-10-14 22:22:00 -04:00
parent 0113d78978
commit 0b72b56594
8 changed files with 21 additions and 14 deletions

View File

@@ -105,6 +105,13 @@ else()
set(YAZE_PROTOBUF_TARGET "")
endif()
set(YAZE_PROTOBUF_WHOLEARCHIVE_TARGETS)
foreach(_yaze_proto_candidate IN LISTS YAZE_PROTOBUF_TARGETS)
if(NOT _yaze_proto_candidate MATCHES "lite")
list(APPEND YAZE_PROTOBUF_WHOLEARCHIVE_TARGETS ${_yaze_proto_candidate})
endif()
endforeach()
# SDL2
include(cmake/sdl2.cmake)