cmake: add backwards compatibility mode

pull/16424/head
Jan Tattermusch 6 years ago
parent 87cd70fab3
commit 43836ced82
  1. 9
      templates/CMakeLists.txt.template

@ -88,6 +88,7 @@
option(gRPC_BUILD_TESTS "Build tests" OFF)
option(gRPC_BUILD_CODEGEN "Build codegen" ON)
option(gRPC_BUILD_CSHARP_EXT "Build C# extensions" ON)
option(gRPC_BACKWARDS_COMPATIBILITY_MODE "Build libraries that are binary compatible across a larger number of OS and libc versions" OFF)
set(gRPC_INSTALL_default ON)
if (NOT CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
@ -164,6 +165,14 @@
set(_gRPC_PROTOBUF_LIBRARY_NAME "libprotobuf")
endif()
if(gRPC_BACKWARDS_COMPATIBILITY_MODE)
add_definitions(-DGPR_BACKWARDS_COMPATIBILITY_MODE)
if (_gRPC_PLATFORM_MAC)
# CMAKE_OSX_DEPLOYMENT_TARGET
add_definitions(-mmacosx-version-min=10.7)
endif()
endif()
if (_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC)
# C core has C++ source code, but should not depend on libstc++ (for better portability).
# We need to use a few tricks to convince cmake to do that.

Loading…
Cancel
Save