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
|
# On Windows, force whole-archive linking for protobuf to ensure all symbols are included
|
||||||
if(MSVC)
|
if(MSVC)
|
||||||
target_link_options(yaze_core_lib PUBLIC /WHOLEARCHIVE:libprotobuf)
|
target_link_options(yaze_core_lib PUBLIC /WHOLEARCHIVE:$<TARGET_FILE:libprotobuf>)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
message(STATUS " - gRPC test harness + ROM service enabled")
|
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
|
# On Windows, force whole-archive linking for protobuf to ensure all symbols are included
|
||||||
if(MSVC)
|
if(MSVC)
|
||||||
target_link_options(yaze_net PUBLIC /WHOLEARCHIVE:libprotobuf)
|
target_link_options(yaze_net PUBLIC /WHOLEARCHIVE:$<TARGET_FILE:libprotobuf>)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
message(STATUS " - gRPC ROM service enabled")
|
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
|
# On Windows, force whole-archive linking for protobuf to ensure all symbols are included
|
||||||
if(MSVC)
|
if(MSVC)
|
||||||
target_link_options(yaze_agent PUBLIC /WHOLEARCHIVE:libprotobuf)
|
target_link_options(yaze_agent PUBLIC /WHOLEARCHIVE:$<TARGET_FILE:libprotobuf>)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Note: YAZE_WITH_GRPC is defined globally via add_compile_definitions in root CMakeLists.txt
|
# 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
|
# On Windows, force whole-archive linking for protobuf to ensure all symbols are included
|
||||||
if(MSVC)
|
if(MSVC)
|
||||||
target_link_options(z3ed PRIVATE /WHOLEARCHIVE:libprotobuf)
|
target_link_options(z3ed PRIVATE /WHOLEARCHIVE:$<TARGET_FILE:libprotobuf>)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
@@ -49,7 +49,7 @@ if(YAZE_BUILD_TESTS)
|
|||||||
target_link_options(${suite_name} PRIVATE /STACK:16777216)
|
target_link_options(${suite_name} PRIVATE /STACK:16777216)
|
||||||
# Force whole-archive linking for protobuf to ensure all symbols are included
|
# Force whole-archive linking for protobuf to ensure all symbols are included
|
||||||
if(YAZE_WITH_GRPC)
|
if(YAZE_WITH_GRPC)
|
||||||
target_link_options(${suite_name} PRIVATE /WHOLEARCHIVE:libprotobuf)
|
target_link_options(${suite_name} PRIVATE /WHOLEARCHIVE:$<TARGET_FILE:libprotobuf>)
|
||||||
endif()
|
endif()
|
||||||
else()
|
else()
|
||||||
target_link_options(${suite_name} PRIVATE -Wl,--stack,16777216)
|
target_link_options(${suite_name} PRIVATE -Wl,--stack,16777216)
|
||||||
|
|||||||
Reference in New Issue
Block a user