aboutsummaryrefslogtreecommitdiffhomepage
path: root/templates
diff options
context:
space:
mode:
authorGravatar Jan Tattermusch <jtattermusch@google.com>2018-08-22 17:14:54 +0200
committerGravatar Jan Tattermusch <jtattermusch@google.com>2018-10-04 11:21:36 +0200
commit43836ced828362e174fd7ac20c2995312abd2f99 (patch)
tree1c6a2d184522d501fb699a737f561dc0f2e73741 /templates
parent87cd70fab3b7388f66b0bfd58e2961b4afe512ef (diff)
cmake: add backwards compatibility mode
Diffstat (limited to 'templates')
-rw-r--r--templates/CMakeLists.txt.template9
1 files changed, 9 insertions, 0 deletions
diff --git a/templates/CMakeLists.txt.template b/templates/CMakeLists.txt.template
index aec1624acd..5fff74f128 100644
--- a/templates/CMakeLists.txt.template
+++ b/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.