CMake builds and Visual Studio 2015

66 views
Skip to first unread message

ste...@soulmachines.com

unread,
Nov 1, 2016, 4:35:30 PM11/1/16
to grpc.io
When building gRPC v1.0.1 with Visual Studio 2015 and using CMake for the build, I have had to modify the grpc/CMakeLists.txt and the third_party/boringssl/CMakeLists.txt.

I don't seem to be able to attach my CMakeLists.txt files but here is a summary:

grpc/CMakeLists.txt
  • added if(NOT MSVC) for the setting of the -std=c11 and -std=c++11 CMAKE_C_FLAGS and CMAKE_CXX_FLAGS.
  • added if (MSVC) for adding the ws2_32 library to the grpc_print_google_default_creds_token and grpc_verify_jwt executables

grpc/thirdparty/boringssl/CMakeLists.txt

  • added the C4464, C4701, C4668, C4623 and C5027 warnings to the MSVC_DISABLED_WARNINGS_LIST variable


I use the following command line to configure grpc

cmake -G "NMake Makefiles" -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/grpc-1.0.1 -DCMAKE_CXX_FLAGS_RELEASE="/MT -D _WIN32_WINNT=0x600" -DCMAKE_C_FLAGS_RELEASE="/MT -D _WIN32_WINNT=0x600" ..


Hope this is helpful to others ...


Reply all
Reply to author
Forward
0 new messages