build: add Windows specific compile option for ssize_t (#24)

* build: add Windows specific compile option for ssize_t

Ensure compatibility on Windows by defining ssize_t as int for the gRPC plugin. This adjustment prevents potential type-related issues during compilation.

* chore: include string header for message handling

Ensure that the string functionality is available for improved message processing.
This commit is contained in:
zhangyi1357 2024-10-14 17:48:07 +08:00 committed by GitHub
parent 515fc49c2d
commit 10153950c8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 0 deletions

View File

@ -37,6 +37,11 @@ target_link_libraries(
aimrt::common::net
nghttp2::nghttp2)
# Set compile options of target
if(WIN32)
target_compile_definitions(${CUR_TARGET_NAME} PRIVATE ssize_t=long)
endif()
# Add -Werror option
include(AddWerror)
add_werror(${CUR_TARGET_NAME})

View File

@ -5,6 +5,7 @@
#include <cstdint>
#include <optional>
#include <string>
#include <string_view>
namespace aimrt::plugins::grpc_plugin::grpc {