fix(build): update protobuf linking for Windows in CMake files

- Modified CMake configurations across multiple files to use `$<TARGET_FILE:libprotobuf>` for whole-archive linking on Windows, ensuring all symbols are included correctly.
- This change enhances compatibility and reliability of the build process when using gRPC.

Benefits:
- Improves build stability on Windows platforms by ensuring proper linking of the protobuf library.
This commit is contained in:
scawful
2025-10-13 14:26:06 -04:00
parent dcbfc0173c
commit cc427d037e
5 changed files with 5 additions and 5 deletions

View File

@@ -149,7 +149,7 @@ if(YAZE_WITH_GRPC)
# On Windows, force whole-archive linking for protobuf to ensure all symbols are included
if(MSVC)
target_link_options(yaze_core_lib PUBLIC /WHOLEARCHIVE:libprotobuf)
target_link_options(yaze_core_lib PUBLIC /WHOLEARCHIVE:$<TARGET_FILE:libprotobuf>)
endif()
message(STATUS " - gRPC test harness + ROM service enabled")

View File

@@ -88,7 +88,7 @@ if(YAZE_WITH_GRPC)
# On Windows, force whole-archive linking for protobuf to ensure all symbols are included
if(MSVC)
target_link_options(yaze_net PUBLIC /WHOLEARCHIVE:libprotobuf)
target_link_options(yaze_net PUBLIC /WHOLEARCHIVE:$<TARGET_FILE:libprotobuf>)
endif()
message(STATUS " - gRPC ROM service enabled")

View File

@@ -165,7 +165,7 @@ if(YAZE_WITH_GRPC)
# On Windows, force whole-archive linking for protobuf to ensure all symbols are included
if(MSVC)
target_link_options(yaze_agent PUBLIC /WHOLEARCHIVE:libprotobuf)
target_link_options(yaze_agent PUBLIC /WHOLEARCHIVE:$<TARGET_FILE:libprotobuf>)
endif()
# Note: YAZE_WITH_GRPC is defined globally via add_compile_definitions in root CMakeLists.txt

View File

@@ -43,6 +43,6 @@ if(YAZE_WITH_GRPC)
# On Windows, force whole-archive linking for protobuf to ensure all symbols are included
if(MSVC)
target_link_options(z3ed PRIVATE /WHOLEARCHIVE:libprotobuf)
target_link_options(z3ed PRIVATE /WHOLEARCHIVE:$<TARGET_FILE:libprotobuf>)
endif()
endif()