refactor(build): enhance MSVC whole-archive linking for protobuf
- Updated CMake configurations across core, net, agent, and z3ed to conditionally apply /WHOLEARCHIVE linking for libprotobuf based on the compiler ID. - Added status messages to indicate when /WHOLEARCHIVE linking is skipped for clang-cl, improving clarity in build logs. Benefits: - Improves compatibility and clarity in the build process for Windows environments using different compilers. - Ensures that necessary symbols are included when using MSVC, enhancing build reliability.
This commit is contained in:
@@ -164,8 +164,10 @@ if(YAZE_WITH_GRPC)
|
||||
)
|
||||
|
||||
# On Windows, force whole-archive linking for protobuf to ensure all symbols are included
|
||||
if(MSVC)
|
||||
if(MSVC AND CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
|
||||
target_link_options(yaze_agent PUBLIC /WHOLEARCHIVE:$<TARGET_FILE:libprotobuf>)
|
||||
elseif(MSVC)
|
||||
message(STATUS "○ Skipping /WHOLEARCHIVE for libprotobuf (clang-cl)")
|
||||
endif()
|
||||
|
||||
# Note: YAZE_WITH_GRPC is defined globally via add_compile_definitions in root CMakeLists.txt
|
||||
|
||||
Reference in New Issue
Block a user