From cc427d037ed31f18621f1dd0c64d1a5be50ecfe4 Mon Sep 17 00:00:00 2001 From: scawful Date: Mon, 13 Oct 2025 14:26:06 -0400 Subject: [PATCH] fix(build): update protobuf linking for Windows in CMake files - Modified CMake configurations across multiple files to use `$` 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. --- src/app/core/core_library.cmake | 2 +- src/app/net/net_library.cmake | 2 +- src/cli/agent.cmake | 2 +- src/cli/z3ed.cmake | 2 +- test/CMakeLists.txt | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/app/core/core_library.cmake b/src/app/core/core_library.cmake index e7c38e47..294e7d1f 100644 --- a/src/app/core/core_library.cmake +++ b/src/app/core/core_library.cmake @@ -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:$) endif() message(STATUS " - gRPC test harness + ROM service enabled") diff --git a/src/app/net/net_library.cmake b/src/app/net/net_library.cmake index a491afbd..3123b7cd 100644 --- a/src/app/net/net_library.cmake +++ b/src/app/net/net_library.cmake @@ -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:$) endif() message(STATUS " - gRPC ROM service enabled") diff --git a/src/cli/agent.cmake b/src/cli/agent.cmake index ebc35bae..dd87ab37 100644 --- a/src/cli/agent.cmake +++ b/src/cli/agent.cmake @@ -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:$) endif() # Note: YAZE_WITH_GRPC is defined globally via add_compile_definitions in root CMakeLists.txt diff --git a/src/cli/z3ed.cmake b/src/cli/z3ed.cmake index 5bfffa33..ac5972bf 100644 --- a/src/cli/z3ed.cmake +++ b/src/cli/z3ed.cmake @@ -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:$) endif() endif() \ No newline at end of file diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 7290b9de..1c0ec492 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -49,7 +49,7 @@ if(YAZE_BUILD_TESTS) target_link_options(${suite_name} PRIVATE /STACK:16777216) # Force whole-archive linking for protobuf to ensure all symbols are included if(YAZE_WITH_GRPC) - target_link_options(${suite_name} PRIVATE /WHOLEARCHIVE:libprotobuf) + target_link_options(${suite_name} PRIVATE /WHOLEARCHIVE:$) endif() else() target_link_options(${suite_name} PRIVATE -Wl,--stack,16777216)