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:
@@ -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")
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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()
|
||||
Reference in New Issue
Block a user