feat(cmake): enhance OpenSSL linking and whole-archive options for Windows

- Updated CMake configurations to conditionally link OpenSSL only when gRPC is not enabled, preventing duplicate symbol errors.
- Added support for whole-archive linking of protobuf on Windows across core, net, agent, and z3ed components to ensure all symbols are included.
- Improved status messages to reflect the use of gRPC's OpenSSL when applicable.

Benefits:
- Enhanced compatibility and stability of the build process across different platforms and configurations.
This commit is contained in:
scawful
2025-10-12 07:16:47 -04:00
parent 42197eb71f
commit d40ac3372f
4 changed files with 55 additions and 16 deletions

View File

@@ -40,4 +40,9 @@ endif()
if(YAZE_WITH_GRPC)
message(STATUS "Adding gRPC support to z3ed CLI")
target_link_libraries(z3ed PRIVATE grpc++ grpc++_reflection libprotobuf)
# On Windows, force whole-archive linking for protobuf to ensure all symbols are included
if(MSVC)
target_link_options(z3ed PRIVATE /WHOLEARCHIVE:libprotobuf)
endif()
endif()