Warn if users attempt building gRPC servers using MinGW

gRPC in examples using the reference grpc++, which depends on abseil.
There is known upstream issue that abseil passes the MSVC only linker
flag that blocks the example compilation with MinGW compiler. The
problem meanwhile is bigger than that, since abseil simply don't have
a proper MinGW support, so we should warn users, that we do not
officially support MinGW in the examples that use the reference gRPC
server implementation.

Pick-to: 6.8 6.7
Fixes: QTBUG-128174
Change-Id: I319c54b5df02dac0be1dee441ec324f54f05ad93
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This commit is contained in:
Alexey Edelev 2024-08-23 12:00:47 +02:00
parent 23ea0be517
commit a5d79af204
3 changed files with 18 additions and 0 deletions

View File

@ -20,6 +20,12 @@ if(NOT TARGET WrapgRPC::WrapgRPCPlugin OR NOT TARGET WrapProtoc::WrapProtoc
return()
endif()
if(MINGW)
message(WARNING "${PROJECT_NAME} uses reference grpc++ library that doesn't officially support"
" MinGW. Please use the MSVC compiler to build this example. The correct work is not"
" guaranteed otherwise.")
endif()
set(proto_files "${CMAKE_CURRENT_LIST_DIR}/../proto/simplechat.proto")
set(out_dir "${CMAKE_CURRENT_BINARY_DIR}")

View File

@ -16,6 +16,12 @@ if(NOT TARGET WrapgRPC::WrapgRPCPlugin OR NOT TARGET WrapProtoc::WrapProtoc
return()
endif()
if(MINGW)
message(WARNING "${PROJECT_NAME} uses reference grpc++ library that doesn't officially support"
" MinGW. Please use the MSVC compiler to build this example. The correct work is not"
" guaranteed otherwise.")
endif()
# Avoid "Protobuf requires at least C++11." errors
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

View File

@ -16,6 +16,12 @@ if(NOT TARGET WrapgRPC::WrapgRPCPlugin OR NOT TARGET WrapProtoc::WrapProtoc
return()
endif()
if(MINGW)
message(WARNING "${PROJECT_NAME} uses reference grpc++ library that doesn't officially support"
" MinGW. Please use the MSVC compiler to build this example. The correct work is not"
" guaranteed otherwise.")
endif()
set(proto_files
"${CMAKE_CURRENT_LIST_DIR}/../proto/vehicleservice.proto"
"${CMAKE_CURRENT_LIST_DIR}/../proto/naviservice.proto")