oreoswift.blogg.se

Grpc windows cmake
Grpc windows cmake





grpc windows cmake
  1. GRPC WINDOWS CMAKE HOW TO
  2. GRPC WINDOWS CMAKE INSTALL

I followed the main guide located on libtin's github.io page (located here ) and another guide from StackOverflow (located here ) that uses Visual Studio, but I am using CMake so those. Perhaps this should be controlled by a variable that defaults to CMAKE_CXX_STANDARD and if it's not set - to 11. I am trying to compile a project using Visual Studio Code on Windows that uses the libtins library but I am having trouble getting CMake to link the library. There should be a way to set C++ standard used in gRPC CMake build.

GRPC WINDOWS CMAKE INSTALL

Point 2 also means that if a user wants to install gRPC using gRPC_INSTALL option, they must specify C++ standard used.

grpc windows cmake

This means that if both gRPC and user's code want to depend on Abseil, they MUST use the same C++ standard. Abseil is ABI-incompatible between different C++ standard versions, because it conditionally aliases some of its classes to standard library instead of defining them. With any dependency on Abseil library this becomes more dramatic.In this case the ordering of the flags makes both Clang and G++ use that C++17 (which is probably good), but this is relying on undocumented behavior. It supports building on Linux, MacOS and Windows (official support) but also has a good chance of working. The full example is available in my github account: gRPC CMake example. cmake is your best option if you cannot use bazel.

GRPC WINDOWS CMAKE HOW TO

Now that I found the time, I want to write a bit about how to use this in your project to automatically generate C++ code from your protobuf files.

  • If the user has CMAKE_CXX_STANDARD variable set (let's say, to 17) and includes gRPC with add_subdirectory, the command line for the calls will include both -std=c++11 and -std=c++17. A while back, I contributed plugin/grpc support to the CMake package that comes with protobuf.
  • There are several problems with this approach: (Not going to use the standard bug request form, because I am going to highlight a potential problem that would only become real with more use of Abseil).Ĭurrently C++ standard is set for gRPC by appending -std=c++11 to CMAKE_CXX_FLAGS.







    Grpc windows cmake